🎨

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

Octonion Multiplication Table

The crown jewel—a fully colorized 8D algebra visualization where the Fano plane structure becomes immediately visible through color patterns.

06_octonion_color_table.sio
╔══════════════════════════════════════════════════════════════════════════╗
           OCTONION MULTIPLICATION TABLE - Color Edition              
╚══════════════════════════════════════════════════════════════════════════╝

    ×  1    i    j    k    l   il   jl   kl
  ────┼────────────────────────────────────────────────
 11    i    j    k    l   il   jl   kl
 ii   -1    k   -j   il   -l  -kl   jl
 jj   -k   -1    i   jl   kl   -l  -il
 kk    j   -i   -1   kl  -jl   il   -l
 ll  -il  -jl  -kl  -1    i    j    k
ilil    l  -kl   jl  -i   -1   -k    j
jljl   kl    l  -il  -j    k   -1   -i
klkl  -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.

02_fmri_octonion_activation.sio
╔═══════════════════════════════════════════════════╗
     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.

phase3_showcase.sio - Rotating Cube
╔═══════════════════════════════════════════════════╗
          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.

phase5_showcase.sio - Particle Fountain
╔═══════════════════════════════════════════════════╗
       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.

phase5_showcase.sio - Fluid Dynamics
╔═══════════════════════════════════════════════════╗
         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.

phase6_showcase.sio - Bifurcation
╔═══════════════════════════════════════════════════╗
    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 pointperiod-2period-4chaos

Force-Directed Graph Layout

Social network visualization with Fruchterman-Reingold algorithm.

phase7_showcase.sio - Network Graph
╔═══════════════════════════════════════════════════╗
      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.

10_kalman_filter_color.sio
╔═══════════════════════════════════════════════════╗
      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.

08_climate_ensemble_color.sio
╔═══════════════════════════════════════════════════╗
    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

PhaseModulesCapabilities
Phase 1canvas, colors, drawing, textCore primitives, ANSI colors, shapes
Phase 2axes, scatter, line_plot, bar_chart, histogram, heatmap2D plotting
Phase 3projection, wireframe, scatter3d3D visualization
Phase 4input, interactive_plotZoom, pan, mouse/keyboard
Phase 5animation, particle_system, fluid_simAnimation, physics
Phase 6phase_diagram, bifurcation, poincare, streamlinesScientific charts
Phase 7graph, force_directed, tree_layout, graph_renderNetwork visualization

Get Started

sounio new graphics-project --template graphics
cd graphics-project
sounio run examples/rotating_cube.sio