logoalt Hacker News

Show HN: I ported Manim to TypeScript (run 3b1B math animations in the browser)

61 pointsby maloyanlast Wednesday at 6:15 PM12 commentsview on HN

Hi HN, I'm Narek. I built Manim-Web, a TypeScript/JavaScript port of 3Blue1Brown’s popular Manim math animation engine.

The Problem: Like many here, I love Manim's visual style. But setting it up locally is notoriously painful - it requires Python, FFmpeg, Cairo, and a full LaTeX distribution. It creates a massive barrier to entry, especially for students or people who just want to quickly visualize a concept.

The Solution: I wanted to make it zero-setup, so I ported the engine to TypeScript. Manim-Web runs entirely client-side in the browser. No Python, no servers, no install. It runs animations in real-time at 60fps.

How it works underneath: - Rendering: Uses Canvas API / WebGL (via Three.js for 3D scenes). - LaTeX: Rendered and animated via MathJax/KaTeX (no LaTeX install needed!). - API: I kept the API almost identical to the Python version (e.g., scene.play(new Transform(square, circle))), meaning existing Manim knowledge transfers over directly. - Reactivity: Updaters and ValueTrackers follow the exact same reactive pattern as the Python original.

Because it's web-native, the animations are now inherently interactive (objects can be draggable/clickable) and can be embedded directly into React/Vue apps, interactive textbooks, or blogs. I also included a py2ts converter to help migrate existing scripts.

Live Demo: https://maloyan.github.io/manim-web/examples GitHub: https://github.com/maloyan/manim-web

It's open-source (MIT). I'm still actively building out feature parity with the Python version, but core animations, geometry, plotting, and 3D orbiting are working great. I would love to hear your feedback, and I'll be hanging around to answer any technical questions about rendering math in the browser!


Comments

itishappytoday at 6:17 AM

Bug reports:

The entire Manim CE Logo example, the `x - x_1` text from the Brace Annotation example, all text from the Sin Cos Plot example, and the entire Heat Diagram example all flicker roughly once per second.

The text looks rather fuzzy, especially the large M from the Manim CE Logo example.

The Three D Light Source example also doesn't appear to have any functioning directional lighting.

jasonjmcgheetoday at 6:03 AM

Motion Canvas is a mature / popular solution in the "manim but typescript" space for those unfamiliar.

It can be used for interactive blog posts and embedded animations etc as well.

It also has a built in animation editor / timeline.

https://github.com/motion-canvas/motion-canvas

show 2 replies
ziotom78today at 5:34 AM

Thank you! I regularly use Reveal.js to create interactive slide decks for my classes, and your project will be a great tool to have!

anematodetoday at 4:56 AM

Amazing!! This is a project I've wanted to tackle for years but never got the chance to properly do.

sriram_malhartoday at 4:36 AM

This is fantastic! Thank you for sharing.

socalgal2today at 4:33 AM

thank you! this is awesome!!!

I'm far more into the web than python and have wanted something I could drop into a web page.

unovatoday at 4:34 AM

Congrats! This looks awesome!

hamishwhctoday at 6:09 AM

Now someone’s going to write a react-manim renderer I’m sure.