Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

plotters-rs/plotters-wasm-demo

Repository files navigation

Example Project of Plotters + WASM

This is a minimal project that uses Plotters in WASM application.

  • For more information about Plotters project, check our core repository.

  • This demo has been deployed at this link.

Try this example locally

To build the demo you need wasm-pack.

Then you can run it locally either using npm and webpack-dev-server or just with static web server.

The following script will install needed software and run the server via npm.

./start-server.sh

For Windows users without Bash, start-server.bat can be used to launch the server.

start-server.bat

Developing with NPM

Please use rust-wasm guide for initial setup . Then you can run the demo locally using npm:

wasm-pack build
cd www
npm install
npm start

This will start a dev server which will automatically reload your page whenever you change anything in www directory. To update rust code call wasm-pack build manually.

Developing without dependenices

If you don't want to use npm here's how you can run the example using any web server. We are using rust basic-http-server, but any web server will do.

# Install web server (instead you can use your local nginx for example)
cargo install basic-http-server
wasm-pack build --target web # Note `--target web`
basic-http-server

Then open http://127.0.0.1:4000/www

About

Plotters + WebAssembly Example

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 10

AltStyle によって変換されたページ (->オリジナル) /