53 releases (7 breaking)

0.8.4 Jul 13, 2024
0.7.23 Jul 8, 2024
0.5.4 Mar 28, 2024

#54 in WebAssembly

Download history 79/week @ 2024-03-31 1/week @ 2024-04-07 127/week @ 2024-06-02 925/week @ 2024-06-09 845/week @ 2024-06-16 1706/week @ 2024-06-23 626/week @ 2024-06-30 422/week @ 2024-07-07 116/week @ 2024-07-14

2,973 downloads per month

MIT and AGPL-3.0-or-later

4MB
26K SLoC

Rust 15K SLoC // 0.0% comments JavaScript 9K SLoC // 0.3% comments TypeScript 2.5K SLoC // 0.6% comments

MathLikeAnim-rs

MathLikeAnim-rs

This is an animation library written in Rust, widely inspired by Manim and, unlike Manim, it allows interactivity thanks to WebAssembly, JavaScript and the web.

Features

  • Interactivity.
  • Basic shapes.
  • Function plotting.
  • Animations in HTML Canvas, SVG and videos for Node.js.
  • Text rendering.
  • LaTeX rendering.
  • 3D rendering.
  • Browser and Node.js support.
  • Python support (coming soon).

How to use it in the browser?

You can embed the library in your HTML file by adding a script tag, and don't forget to include your HTML Canvas for raster animations or DIV container for SVG animations!

<script type="module">
    import mathlikeanimRs from './node_modules/mathlikeanim-rs/browser/mathlikeanim_rs.js';
</script>

How to use it in Node.js?

You can use the library in Node.js by importing the module and using it as a CommonJS module.

Note: Interactivity is not supported in Node.js.

const mathlikeanimRs = require('mathlikeanim-rs')

How to install it?

If you want to start creating mathematical and interactive animations, you can install it by running:

npm i mathlikeanim-rs

Development

If you want to contribute to this project, you can clone a fork of this repository and work with the Rust codebase, and then build the WebAssembly module by running in the main directory:

wasm-pack build --target web --out-dir javascript/browser --features browser --no-default-features
wasm-pack build --target nodejs --out-dir javascript/node --features node --no-default-features

By the moment we don't have any tests, so your contributions are welcome!

Documentation

You can find the documentation of this project in https://mathlikeanim-rs.vercel.app/.

Dependencies

~18MB
~271K SLoC