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 doMathTex(f"\\text{{{tex_code}}}")to render LaTeX text instead ofTex(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, becauseTextisn'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
Textwill be available soon!
Acknowledgements
Thanks to the Manim Community developers and 3Blue1Brown for developing a great animation engine!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b062534c6eec3ce1bc237e19d733d1ac888f870116ee0bb4d2c992188dca1fc
|
|
| MD5 |
b18f75502c56b94f499e354bcda7f900
|
|
| BLAKE2b-256 |
81d2f501d4718c2581e04efa34b283271b4f6e6ff3250498000501c4459cf0d5
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5be43a80d7c72dbcb001fd57e131084feb15d34782cf72f31d5f6af2530d082a
|
|
| MD5 |
1082ee2fc2b453bde339259e06260a4d
|
|
| BLAKE2b-256 |
0515c0c4d5b4fad81049d29c314d2e140c7dbf63fba6f1203bebb573652fe91a
|