Interactive visual guides to the math and systems programming behind the dgCMatrix → faer FFI bridge.
index.html— the main interface (loads KaTeX and local assets)style.css— glassmorphic design tokens and dark/light theme logicmath-systems.js— core engine: 8 interactive visualizations + CG solver
Serve the folder locally so fonts and icons load correctly:
# Python
python3 -m http.server
# Node
npx serve .- Pipeline — architectural flow: R → FFI → Rust → CG solver
- Vectors in Memory — mathematical notation vs. contiguous
f64byte layout - Sparse vs Dense — CSC (Compressed Sparse Column) memory efficiency
- Graph → Laplacian — real-time Laplacian construction from interactive grids
- Iterative Solve — Conjugate Gradient solver with live convergence plotting
- FFI Boundary — safety mapping between R slots and Rust types
- Spectral View — low-pass filter response h(λ) = 1/(1+αλ) with real eigenvalue spikes
- Complexity — O(N³) dense vs. O(N) sparse CG
Every visualization renders to an HTML5 Canvas and can be exported as a high-res PNG. Open the browser console and run:
const c = document.getElementById("ffi-canvas");
const link = document.createElement("a");
link.download = "figure-export.png";
link.href = c.toDataURL("image/png");
link.click();Canvas IDs: pipeline-canvas, vec-canvas, sparse-canvas,
graph-canvas, cg-canvas, ffi-canvas, eigen-canvas, complexity-canvas
High-res tips:
- Already HiDPI-aware (2x on Retina)
- For 4K/print quality, set
window.devicePixelRatio = 4then calldrawAll()before exporting