ManimCommunity / ManimCommunity/manim
PyScript Support
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 40.9k
- Forks
- 3.1k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 25
Description
Description of proposed feature
Anaconda has recently launched PyScript:
PyScript is a framework that allows users to create rich Python applications in the browser using HTML's interface and the power of Pyodide, WASM, and modern web technologies. The PyScript framework provides users at every experience level with access to an expressive, easy-to-learn programming language with countless applications.
It would be nice to be able to run Manim directly in the browser, though this probably requires many long and extra steps, such as.
- compiling Cairo and Pango to Wasm,
- either compiling a minimal TeX distribution to Wasm, or allowing to use e.g. MathJax or KaTeX as an alternative renderer for equations
- ... (I'm not a core dev, so please add other work that would have to be performed)
How can the new feature be used?
- Try out Manim directly without having to install anything on their computer.
- Real-time collaborative editing (multiple people working on the same animation at the same time).
- ...
Additional comments
Here is a basic HTML file that tries to import Manim.
<html>
<head>
<link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />
<script defer src="https://pyscript.net/alpha/pyscript.js"></script>
<py-env>
- manim
</py-env>
</head>
<body>
</body>
</html>
This throws an error:
ValueError: Couldn't find a pure Python 3 wheel for 'pycairo<2.0,>=1.19'. You can use
micropip.install(..., keep_going=True)to get a list of all packages with missing wheels.
This article explains why this happens:
To sum up, a third-party library listed in
<py-env>must be a pure-Python one and be distributed using the wheel format to be picked up, unless it’s already been built for WebAssembly and bundled with Pyodide. Getting a custom non-pure-Python library into PyScript is tricky.
I will continue to try things out and post my findings here.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the provided HTML example and the reported pycairo wheel error, then review the linked PyScript, Pyodide, WebAssembly, and dependency documentation. Done would require a defined path for running Manim in the browser, including the listed Cairo, Pango, and equation-rendering dependencies; the issue does not identify implementation files or tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html, python, wasm
- Domain
- computer-graphics, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100