#graphics #2d

piet-web

Web canvas backend for piet 2D graphics abstraction

29 releases

0.6.2 Jan 30, 2023
0.6.0 Nov 24, 2022
0.5.0 Nov 12, 2021
0.4.0 Mar 28, 2021
0.0.2 Feb 22, 2019

#98 in Graphics APIs

Download history 161/week @ 2023-06-07 885/week @ 2023-06-14 1564/week @ 2023-06-21 883/week @ 2023-06-28 878/week @ 2023-07-05 754/week @ 2023-07-12 1228/week @ 2023-07-19 1280/week @ 2023-07-26 614/week @ 2023-08-02 1038/week @ 2023-08-09 1110/week @ 2023-08-16 974/week @ 2023-08-23 545/week @ 2023-08-30 1191/week @ 2023-09-06 1042/week @ 2023-09-13 563/week @ 2023-09-20

3,622 downloads per month
Used in 51 crates (2 directly)

MIT/Apache

395KB
4.5K SLoC

Running the examples

Ensure both cargo and npm are installed.

Make sure that wasm-pack is installed:

$ cargo install wasm-pack

Then run the following:

$ cd examples/basic && ./build.sh

Then navigate your browser to the local web server that was started.

Testing

The easiest way is to use wasm-pack:

$ cargo install wasm-pack

Then use wasm-pack to run the tests:

$ wasm-pack test --chrome --headless

Tests are currently run only against chrome, once tests are made less brittle we'll also run against other browsers.

References:


lib.rs:

The Web Canvas backend for the Piet 2D graphics abstraction.

Dependencies

~10MB
~192K SLoC