What the Project Does
Lantern adapts the animation principles of Manim into a dependency-free TypeScript library. It is designed to generate steppable, animated visual explainers for code diffs and logic. Instead of producing video files, Lantern renders straight to SVG—either as a reactive DOM tree in the browser or as SVG strings within Node.js and Cloudflare Workers.
Technical Architecture
At its core, geometric state is stored in Float32Array buffers (Mobject), while paths are handled as cubic Bézier curves (VMobject). Text is rendered using pre-extracted vector glyph outlines for fonts like Inter and JetBrains Mono. This deterministic approach allows precise letter-by-letter transforms without font rasterisation discrepancies across platforms. Scenes can be authored as TypeScript classes with async steps, converted from Mermaid diagrams, or loaded from JSON documents.
Target Audience and Maturity
Lantern is intended for developers creating technical explainers, documentation, and agent workflows that inspect execution traces or diffs programmatically. The project is currently in an early stage: it is not yet published to npm and requires cloning the repository. However, the codebase demonstrates careful engineering, using Node 24 native TypeScript execution, automated frame testing, and dedicated motion verification checks.