Terminal Graphics
Beautiful scientific visualization with ASCII art, ANSI colors, and terminal-native 3D rendering
Terminal Graphics Library
Sounio provides a comprehensive terminal-native graphics library for scientific visualization. No GUI libraries, no X11, no dependencies—just Unicode and ANSI escape codes that work everywhere, including SSH sessions.
Why Terminal Graphics?
- Works everywhere: SSH, Docker, minimal systems, remote servers
- Zero dependencies: No matplotlib, no OpenGL, no external libraries
- Fast: All examples render in under 1 second
- SSH-friendly: Perfect for remote scientific computing
Gallery
Octonion Multiplication Table
The crown jewel—a fully colorized 8D algebra visualization where the Fano plane structure becomes immediately visible through color patterns.
╔══════════════════════════════════════════════════════════════════════════╗ ║ OCTONION MULTIPLICATION TABLE - Color Edition ║ ╚══════════════════════════════════════════════════════════════════════════╝ × │ 1 i j k l il jl kl ────┼──────────────────────────────────────────────── 1 │ 1 i j k l il jl kl i │ i -1 k -j il -l -kl jl j │ j -k -1 i jl kl -l -il k │ k j -i -1 kl -jl il -l l │ l -il -jl -kl -1 i j k il │ il l -kl jl -i -1 -k j jl │ jl kl l -il -j k -1 -i kl │ kl -jl il l -k -j i -1 Legend: 1=real ijk=quaternion liljlkl=octonion dim=negative
fMRI Brain Activation Heatmap
32×32 brain slice visualization with gradient intensity using Unicode block characters.
╔═══════════════════════════════════════════════════╗ ║ fMRI BRAIN ACTIVATION - Slice z=32 ║ ╚═══════════════════════════════════════════════════╝ Anterior ░░░░░░░░░░░░░░░░░░░ ░░░░░░▒▒▒▒▒▒▒▒░░░░░░░░ ░░░░▒▒▒████████▒▒▒░░░░ ░░░▒▒████████████████▒▒░░░ ░░░▒▒████████████████████▒▒░░░ L ░░▒▒███████░░░░███████▒▒░░ R ░░▒▒███████░░░░░░███████▒▒░░ ░░▒▒████████░░████████▒▒░░ ░░░▒▒████████████████▒▒░░░ ░░░░▒▒▒████████▒▒▒░░░░ ░░░░░░▒▒▒▒▒▒▒▒░░░░░░░░ ░░░░░░░░░░░░░░░░░░░ Posterior Intensity: ░=0.0 ▒=0.3 █=0.6 █=1.0 Regions: Visual Motor Frontal
3D Wireframe Cube
Rotating cube with isometric projection and axis indicators.
╔═══════════════════════════════════════════════════╗ ║ 3D WIREFRAME CUBE - Frame 42 ║ ╚═══════════════════════════════════════════════════╝ Y │ ┌───────────┐ ╱│ ╱│ ╱ │ ╱ │ ╱ │ ╱ │ ┌───────────┐ │ │ │ │ │ │ └───────│───┘ │ ╱ │ ╱ │ ╱ │ ╱ │╱ │╱ └───────────┘──────X ╱ Z Projection: Isometric (30°) Axes: X=red Y=green Z=blue
Particle System Animation
Physics-based particle fountain with gravity and drag forces.
╔═══════════════════════════════════════════════════╗ ║ PARTICLE FOUNTAIN - Frame 120 ║ ╚═══════════════════════════════════════════════════╝ ★ ★ ★ · · · ★ ★ · · · ○ · · ○ · · ○ ○ ○ ○ · │ · · │ · · │ · ════════════════════█════════════════════ Particles: 847 active Physics: gravity=0.1, drag=0.99, wind=0.02 Lifetime: ★=new ·=mid ·=old
Fluid Dynamics (Navier-Stokes)
Smoke simulation based on Jos Stam’s “Stable Fluids” algorithm.
╔═══════════════════════════════════════════════════╗ ║ FLUID DYNAMICS - Smoke Rising ║ ╚═══════════════════════════════════════════════════╝ ░░░░░░ ░░░░▒▒░░░░ ░░▒▒▓▓▒▒░░░░ ░░░▒▒██▓▓▒▒░░░░ ░░░░▒▒▓▓██▓▓▒▒░░░░░ ░░▒▒▓▓████▓▓▒▒░░ ░░▒▒████▒▒░░ ▒▒████▒▒ ▓▓██▓▓ ████ ████ ▓▓▓▓ ░██░ ▀▀ ═══════════════════════════════════════════ Algorithm: Stable Fluids (Stam 1999) Grid: 64×64, viscosity=0.0001
Bifurcation Diagram
Logistic map showing period-doubling cascade to chaos.
╔═══════════════════════════════════════════════════╗ ║ LOGISTIC MAP BIFURCATION - Period Doubling ║ ╚═══════════════════════════════════════════════════╝ x↑ 1│ ░░░░░░░░░░░░ │ ░░▒▒▒▒▒▒▒▒░░ │ ░░▒▒████████▒▒ │ ▒▒▒▒████████▒▒░ │ ▒▒▒▒ ████████ │ ▒▒▒▒ ████████ │ ▒▒▒▒ ██ ██ │ ░░░ █ █ │ ░░░░ │ ░░░░ │ ░░░░ 0│░░░░░ └──────────────────────────────────────────────→r 2.5 3.0 3.5 4.0 x_{n+1} = r × x_n × (1 - x_n) Shows: fixed point → period-2 → period-4 → chaos
Force-Directed Graph Layout
Social network visualization with Fruchterman-Reingold algorithm.
╔═══════════════════════════════════════════════════╗ ║ FORCE-DIRECTED GRAPH - Social Network ║ ╚═══════════════════════════════════════════════════╝ (Bob)─────────(Eve) │╲ ╱│ │ ╲ ╱ │ │ ╲ ╱ │ │ ╲ ╱ │ │ ╲ ╱ │ │ ╲ ╱ │ │ ╲ ╱ │ (Alice)───(Carol) │ ╱ ╲ │ │ ╱ ╲ │ │ ╱ ╲ │ │ ╱ ╲ │ │ ╱ ╲ │ │ ╱ ╲ │ │╱ ╲│ (Dave)─────────(Frank) Nodes: 6 Edges: 12 Algorithm: Fruchterman-Reingold Temperature: 0.05 (converged)
Kalman Filter Uncertainty
Sequential Bayesian belief updates with color-coded confidence levels.
╔═══════════════════════════════════════════════════╗ ║ KALMAN FILTER - Sensor Fusion ║ ╚═══════════════════════════════════════════════════╝ Uncertainty Reduction Through Sensor Fusion: Prior (σ=10.0m): ████████████████████████████████████████ HIGH After GPS (σ=4.5m): ██████████████████ MEDIUM After IMU (σ=0.5m): ██ LOW After Lidar (σ=0.1m): ▏ VERY LOW Precision Growth (1/σ²): Prior: ▏ +GPS: █ +IMU: ████████ +Lidar: ████████████████████████████████ Total uncertainty reduction: 99% Precision gain: 10,405×
Climate Ensemble Projections
Multi-model climate projections with structural uncertainty visualization.
╔═══════════════════════════════════════════════════╗ ║ CMIP6 CLIMATE PROJECTIONS - SSP2-4.5 ║ ╚═══════════════════════════════════════════════════╝ Global Mean Temperature Change (2100 vs 1850-1900): GFDL-ESM4: ██████████████████│ 1.8°C ± 0.2 HadGEM3: █████████████████████│ 2.1°C ± 0.3 MIROC6: ███████████████████│ 1.9°C ± 0.25 IPSL-CM6A: ███████████████████████│ 2.3°C ± 0.4 MPI-ESM: ████████████████████│ 2.0°C ± 0.1 ├─────────────────────────────────┤ 0 1.5°C 3.0°C Ensemble Mean: ████████████████████│ 2.02°C ± 0.18 ⚠ Paris 1.5°C target: 12% probability of staying below ⚠ Paris 2.0°C target: 47% probability of staying below
Running the Examples
# Scientific visualizations
cargo run --bin souc -- run examples/visual/06_octonion_color_table.sio
cargo run --bin souc -- run examples/visual/10_kalman_filter_color.sio
cargo run --bin souc -- run examples/visual/12_animated_diffusion.sio
# Graphics library demos
cargo run --bin souc -- run examples/graphics/demos/phase3_showcase.sio # 3D
cargo run --bin souc -- run examples/graphics/demos/phase5_showcase.sio # Animation
cargo run --bin souc -- run examples/graphics/demos/phase7_showcase.sio # Networks
Library Structure
| Phase | Modules | Capabilities |
|---|---|---|
| Phase 1 | canvas, colors, drawing, text | Core primitives, ANSI colors, shapes |
| Phase 2 | axes, scatter, line_plot, bar_chart, histogram, heatmap | 2D plotting |
| Phase 3 | projection, wireframe, scatter3d | 3D visualization |
| Phase 4 | input, interactive_plot | Zoom, pan, mouse/keyboard |
| Phase 5 | animation, particle_system, fluid_sim | Animation, physics |
| Phase 6 | phase_diagram, bifurcation, poincare, streamlines | Scientific charts |
| Phase 7 | graph, force_directed, tree_layout, graph_render | Network visualization |
Get Started
sounio new graphics-project --template graphics
cd graphics-project
sounio run examples/rotating_cube.sio