Skip to main content

Animation engine for explanatory math videos, for the web.

Project description

Manim Web: The ManimCE fork to create interactive math animations in the web

Do you want to turn your ManimCE code into an interactive web animation? This is your library!

Main changes

  • MathJax LaTeX rendering: As we're using a web browser, we can't use system's LaTeX. Instead, we use a really faster implementation called MathJax, that delivers math equations for the web. Notice that there's no Tex, so you can do MathTex(f"\\text{{{tex_code}}}") to render LaTeX text instead of Tex(tex_code).
  • Text rendering without Pango (under development): As Pango needs a system, we can't render text with Pango, but we'll use JavaScript libraries to handle that stuff (you don't need any JS, just internal working). This is still under development, so if you try to call Text("Hello, world!"), this will raise an error, because Text isn't still ready!
  • Interactive animations and integration with JavaScript: You can now create interactive animations that can be controlled by the user. This is done by using JavaScript to handle events and Manim Web to create the animations.

Installation

Wait, this is not a system library, so you don't need to install it! In fact, you must start with an HTML file that includes Pyodide and loads Manim Web with micropip.install("manim-web"). An example is at the demo section below.

Demo

You have an example at https://mathityt.github.io/manim-web-demo/. The source code is at https://github.com/MathItYT/manim-web-demo.

Usage

You can use Manim Web like you use ManimCE, but with some differences. Some objects and methods are not available, like Text mobject.

from manim import *


class MyScene(Scene):
    def construct(self):
        # Create a square
        square = Square()
        # Add the square to the scene
        self.add(square)
        # Wait for 1 second
        self.wait(1)
        # Rotate the square
        self.play(square.animate.rotate(PI / 4))
        # Wait for 1 second
        self.wait(1)

Limitations

  • No Pango text rendering: As mentioned above, Pango is not available in the web, so text rendering is not available yet. But Text will be available soon!

Acknowledgements

Thanks to the Manim Community developers and 3Blue1Brown for developing a great animation engine!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

manim_web-0.1.8.post0.tar.gz (368.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

manim_web-0.1.8.post0-py3-none-any.whl (426.1 kB view details)

Uploaded Python 3

File details

Details for the file manim_web-0.1.8.post0.tar.gz.

File metadata

  • Download URL: manim_web-0.1.8.post0.tar.gz
  • Upload date:
  • Size: 368.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.0 CPython/3.12.8 Windows/11

File hashes

Hashes for manim_web-0.1.8.post0.tar.gz
Algorithm Hash digest
SHA256 0b062534c6eec3ce1bc237e19d733d1ac888f870116ee0bb4d2c992188dca1fc
MD5 b18f75502c56b94f499e354bcda7f900
BLAKE2b-256 81d2f501d4718c2581e04efa34b283271b4f6e6ff3250498000501c4459cf0d5

See more details on using hashes here.

File details

Details for the file manim_web-0.1.8.post0-py3-none-any.whl.

File metadata

  • Download URL: manim_web-0.1.8.post0-py3-none-any.whl
  • Upload date:
  • Size: 426.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.0 CPython/3.12.8 Windows/11

File hashes

Hashes for manim_web-0.1.8.post0-py3-none-any.whl
Algorithm Hash digest
SHA256 5be43a80d7c72dbcb001fd57e131084feb15d34782cf72f31d5f6af2530d082a
MD5 1082ee2fc2b453bde339259e06260a4d
BLAKE2b-256 0515c0c4d5b4fad81049d29c314d2e140c7dbf63fba6f1203bebb573652fe91a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page