Skip to content

maloyan/manim-web

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

260 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

manim-web

Mathematical animations for the web.

The power of 3Blue1Brown's Manim — in the browser, no Python required.

Square to Circle demo

npm version CI codecov License: MIT

Quick Start · Examples · Docs · npm


Quick Start

npm install manim-web
import { Scene, Circle, Square, Create, Transform, FadeOut } from 'manim-web';

async function squareToCircle(scene: Scene) {
  const square = new Square({ sideLength: 3 });
  const circle = new Circle({ radius: 1.5 });

  await scene.play(new Create(square));
  await scene.play(new Transform(square, circle));
  await scene.play(new FadeOut(square));
}

Or use a plain <script> tag — see the examples for more.

What You Can Build

Function Graphs
Function Graphs
LaTeX Equations
LaTeX Equations
Text Animations
Text Animations
Geometry Transforms
Geometry Transforms

Features

  • Geometry — Circle, Rectangle, Polygon, Arrow, Arc, Star, Brace, and more
  • Text & LaTeX — Text, MathTex, Tex, Paragraph via KaTeX
  • Graphing — Axes, NumberPlane, FunctionGraph, ParametricFunction, VectorField, BarChart
  • 3D — Sphere, Cube, Cylinder, Torus, Surface3D, ThreeDAxes with orbit controls
  • Animations — FadeIn/Out, Create, Transform, Write, GrowFromCenter, AnimationGroup, LaggedStart
  • Interaction — Draggable, Hoverable, Clickable mobjects
  • Export — GIF and video export
  • Graphs & Tables — Network graphs, Matrix, Table

Framework Integrations

React

import { ManimScene } from 'manim-web/react';

function App() {
  return <ManimScene construct={squareToCircle} width={800} height={450} />;
}

Vue

<script setup>
import { ManimScene } from 'manim-web/vue';
</script>

<template>
  <ManimScene :construct="squareToCircle" :width="800" :height="450" />
</template>

Python to TypeScript

Have existing Manim scripts? Convert them:

node tools/py2ts.cjs input.py -o output.ts

Contributing

git clone https://github.com/maloyan/manim-web.git
cd manim-web
npm install
npm run dev

License

MIT

About

Mathematical animations for the web — Manim in TypeScript

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors