🦀 Rust + 🕸 Wasm = ❤
Find the closest pair of points on a 2-D plane, built with Rust + WebAssembly. The actual algorithm to find the points is inside closest-pair, see its README for more detail.
Install wasm-pack
cargo install wasm-pack
Then follow these steps
wasm-pack build
cd www
npm install
npm run start
Go to ./www
and run
npm run build
You should get the whole web application in the directory dist
. Copy the files inside dist
to your server. Make sure your server is configured so that it serves .wasm
files with the correct MIME type application/wasm
.
- Add a grid to the canvas.
- Add a footer.
- Generalize the
closest_pair
function.