Metadata-Version: 2.4
Name: manim-web
Version: 0.1.5
Summary: Animation engine for explanatory math videos, for the web.
Project-URL: repository, https://github.com/MathItYT/manim
Project-URL: documentation, https://docs.manim.community/
Project-URL: homepage, https://www.manim.community/
Project-URL: Bug Tracker, https://github.com/MathItYT/manim/issues
Project-URL: Changelog, https://docs.manim.community/en/stable/changelog.html
Project-URL: Discord, https://www.manim.community/discord/
Author-email: Benjamín Ubilla <benjamin.ubilla@uc.cl>
License-Expression: MIT
License-File: LICENSE
License-File: LICENSE.community
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Multimedia :: Graphics
Classifier: Topic :: Multimedia :: Video
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.9
Requires-Dist: audioop-lts>=0.2.1; python_full_version >= '3.13'
Requires-Dist: beautifulsoup4>=4.12
Requires-Dist: decorator>=4.3.2
Requires-Dist: importlib-metadata>=8.6.1; python_full_version < '3.10'
Requires-Dist: isosurfaces>=0.1.0
Requires-Dist: networkx>=2.6
Requires-Dist: numpy<=2.0.2,>=2.0
Requires-Dist: pillow>=9.1
Requires-Dist: pygments>=2.0.0
Requires-Dist: scipy>=1.13.0
Requires-Dist: scipy>=1.14.0; python_full_version >= '3.13'
Requires-Dist: svgelements>=1.8.0
Requires-Dist: typing-extensions>=4.12.0
Description-Content-Type: text/markdown

# 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
* **Asynchronous animations:** [`self.play`](http://self.play) and `self.wait` now must be awaited, so `self.construct` method is also an asynchronous function.
* **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](https://pyodide.org/en/stable/) 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/](https://mathityt.github.io/manim-web-demo/). The source code is at [https://github.com/MathItYT/manim-web-demo](https://github.com/MathItYT/manim-web-demo/blob/main/index.html).

## Usage
You can use Manim Web like you use ManimCE, but with some differences. Notice that many stuff are asynchronous (like `self.construct`, `self.play`, `self.wait`, etc.), so you must use `async/await` syntax. Here's an example of a simple scene:

```python
from manim import *


class MyScene(Scene):
    async def construct(self):
        # Create a square
        square = Square()
        # Add the square to the scene
        self.add(square)
        # Wait for 1 second
        await self.wait(1)
        # Rotate the square
        await self.play(square.animate.rotate(PI / 4))
        # Wait for 1 second
        await 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!
* **Retro-compatibility:** As mentioned above, many methods are asynchronous, so you must use `async/await` syntax. This means that you must replace all `self.play` and `self.wait` calls with `await self.play` and `await self.wait`, and also make the `construct` method asynchronous by using `async def construct(self)`.

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