Skip to content

feat(examples): add volatility-surface 3D visualization#2322

Merged
orhun merged 17 commits into
ratatui:mainfrom
floor-licker:examples/volatility-surface
Jan 14, 2026
Merged

feat(examples): add volatility-surface 3D visualization#2322
orhun merged 17 commits into
ratatui:mainfrom
floor-licker:examples/volatility-surface

Conversation

@floor-licker

@floor-licker floor-licker commented Jan 4, 2026

Copy link
Copy Markdown
Contributor

A design demonstration of a 3D volatility surface rendering using Braille canvas with interactive rotation and zoom controls. I built this for myself for an app I'm currently building but just wanted to share it with the community as well to inspire more 3D perspective terminal widgets in the future.

Description

Adds a new example demonstrating 3D visualization techniques in the terminal. There aren't many examples showing how to represent 3D objects in 2D terminal space so my goal is just to demonstrate more advanced Canvas and Braille rendering techniques for 3D graphics. The example visualizes an implied volatility surface which is a common financial visualization using interactive rotation and zoom controls. You can run the interactive demo for yourself with cargo run -p volatility-surface

demo.mov
image

Technical Highlights

  • Demonstrates how to implement perspective projection in a terminal
  • Shows advanced use of Canvas widget with Marker::Braille
  • Example of smooth animation patterns and state management
  • Self-contained with synthetic data generation (no external APIs)

Checklist

  • Follows conventional commit format
  • Code formatted with cargo xtask format
  • Passes cargo xtask ci
  • Documentation included in README
  • Runs with cargo run -p volatility-surface

Run with:
cargo run -p volatility-surface

Final Demo

volatility-surface

@floor-licker
floor-licker requested a review from a team as a code owner January 4, 2026 01:36
@floor-licker
floor-licker force-pushed the examples/volatility-surface branch from 3b9bfd7 to f75d3fa Compare January 4, 2026 01:47
Demonstrates 3D volatility surface rendering using Braille canvas with interactive rotation and zoom controls.
@floor-licker
floor-licker force-pushed the examples/volatility-surface branch from f75d3fa to 63bf981 Compare January 4, 2026 02:33

@joshka joshka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partial review. Will swing back and do more of a review on this later.

Comment thread examples/apps/volatility-surface/src/display/palette.rs
Comment thread examples/apps/volatility-surface/src/display/surface_3d.rs
Comment thread examples/apps/volatility-surface/src/display/surface_3d.rs Outdated
Comment thread examples/apps/volatility-surface/src/display/surface_3d.rs Outdated
Comment thread examples/apps/volatility-surface/src/display/surface_3d.rs Outdated
Comment thread examples/apps/volatility-surface/src/main.rs Outdated
Comment thread examples/apps/volatility-surface/src/main.rs Outdated
Comment thread examples/apps/volatility-surface/src/main.rs Outdated
Comment thread examples/apps/volatility-surface/src/main.rs Outdated
Comment thread examples/apps/volatility-surface/src/main.rs Outdated
@codecov

codecov Bot commented Jan 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.0%. Comparing base (720303e) to head (a3496d1).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #2322   +/-   ##
=====================================
  Coverage   92.0%   92.0%           
=====================================
  Files        100     100           
  Lines      18550   18550           
=====================================
  Hits       17068   17068           
  Misses      1482    1482           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@joshka

joshka commented Jan 4, 2026

Copy link
Copy Markdown
Member

Some extra ideas:

@joshka joshka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run vhs publish after generating the gif (or pass --publish) and paste the gif into the PR body, and I think we're pretty much done on this. This looks pretty cool

Comment thread examples/apps/volatility-surface/src/display/surface_3d.rs Outdated
Comment thread examples/apps/volatility-surface/src/volatility.rs
@orhun

orhun commented Jan 7, 2026

Copy link
Copy Markdown
Member

This looks amazing. Wow

Comment thread examples/apps/volatility-surface/src/display/surface_3d.rs Outdated
Comment thread examples/apps/volatility-surface/src/display/surface_3d.rs Outdated
Comment thread examples/apps/volatility-surface/src/display/surface_3d.rs Outdated
@floor-licker
floor-licker force-pushed the examples/volatility-surface branch from 3d59d20 to de6fdd8 Compare January 8, 2026 01:52
…change I made but rather a dependency update required by CI
@floor-licker
floor-licker requested a review from joshka January 9, 2026 02:40

@j-g00da j-g00da left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so cool! :D

@orhun
orhun merged commit 9d9239a into ratatui:main Jan 14, 2026
36 checks passed
@orhun

orhun commented Jan 14, 2026

Copy link
Copy Markdown
Member

thanks again for your work on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants