Comments (4)
Hi there,
What IDE are you using? I am personally doesn't use any IDE. But it seems the IDE doesn't use WASM target to compile the code. Please note the CnavasBackend
would be enabled only when the target is wasm32
. (See examples/wasm-demo/start-server.sh
for details)
Would you mind try to reproduce this with cargo build
with a CLI output and share your Cargo.toml
with me ?
Hope this is helpful :-)
from plotters.
Thanks for the quick reply!
Here's build output:
Compiling nodrop v0.1.13
Compiling scopeguard v1.0.0
Compiling foreign-types-shared v0.1.1
Compiling either v1.5.2
Compiling adler32 v1.0.3
Compiling color_quant v1.0.1
Compiling lzw v0.10.0
Compiling scoped_threadpool v0.1.9
Compiling approx v0.1.1
Compiling memory_units v0.4.0
Compiling svg v0.5.12
Compiling crossbeam-utils v0.6.6
Compiling foreign-types v0.3.2
Compiling arrayvec v0.4.11
Compiling libc v0.2.62
Compiling core-foundation-sys v0.6.2
Compiling bitflags v1.1.0
Compiling byteorder v1.3.2
Compiling num-traits v0.2.8
Compiling inflate v0.4.5
Compiling memoffset v0.5.1
Compiling wasm-bindgen v0.2.50
Compiling gif v0.10.2
Compiling crossbeam-queue v0.1.2
Compiling crossbeam-epoch v0.7.2
Compiling stb_truetype v0.3.0
Compiling deflate v0.7.20
Compiling num_cpus v1.10.1
Compiling core-foundation v0.6.4
Compiling time v0.1.42
Compiling wee_alloc v0.4.5
Compiling crossbeam-deque v0.7.1
Compiling core-graphics v0.14.0
Compiling rayon-core v1.6.0
Compiling num-integer v0.1.41
Compiling approx v0.3.2
Compiling ordered-float v1.0.2
Compiling tiff v0.2.2
Compiling palette v0.4.1
Compiling core-text v10.0.0
Compiling rusttype v0.8.0
Compiling font-loader v0.8.0
Compiling rayon v1.2.0
Compiling num-iter v0.1.39
Compiling num-rational v0.2.2
Compiling chrono v0.4.9
Compiling png v0.14.1
Compiling rusttype v0.7.9
Compiling jpeg-decoder v0.1.16
Compiling image v0.21.3
Compiling plotters v0.2.5 (/Users/wmain/projects/plotters)
Compiling wasm-demo v0.1.0 (/Users/wmain/projects/plotters/examples/wasm-demo)
error[E0433]: failed to resolve: use of undeclared type or module `CanvasBackend`
--> src/func_plot.rs:8:19
|
8 | let backend = CanvasBackend::new(element).unwrap();
| ^^^^^^^^^^^^^ use of undeclared type or module `CanvasBackend`
error[E0433]: failed to resolve: use of undeclared type or module `CanvasBackend`
--> src/mandelbrot.rs:33:19
|
33 | let backend = CanvasBackend::new(element).unwrap();
| ^^^^^^^^^^^^^ use of undeclared type or module `CanvasBackend`
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0433`.
error: Could not compile `wasm-demo`.
Cargo.toml
[package]
name = "wasm-demo"
version = "0.1.0"
authors = ["Hao Hou <[email protected]>"]
edition = "2018"
[lib]
crate-type=['cdylib']
[dependencies]
plotters = {path = "../.."}
wasm-bindgen = "0.2.43"
wee_alloc = "*"
[profile.release]
lto = true
from plotters.
Adding the target totally fixes this I think! Thanks for the quick response :). This can be closed.
from plotters.
Awesome, closing the issue, feel free to reopen it if anything isn't right :)
from plotters.
Related Issues (20)
- [BUG] stroke_width has no effect on Rectangle (SVGBackend)
- Rapid development of plotters HOT 2
- [BUG] Plotting very slow when using multiple plots.
- Need to update `font-kit` due to `stdsimd` changes HOT 4
- [BUG] LineSeries and draw_series go out of the image scope if stroke_width > 1
- Y labels are not aligned HOT 1
- [BUG] Rotated labels overlap with the chart HOT 1
- Ability to save figures in the same way you can in rust in a notebook environment. HOT 3
- [BUG] currently nightly compiler cannot build plotters due to bug in pathfinder (simd) HOT 11
- [BUG] Even your own Examples doesn't work HOT 3
- [BUG] Drawing series can hang under certain conditions HOT 7
- [BUG] Can't outline/stroke polygon for svg HOT 1
- [BUG] example crash under centos 7.5 HOT 1
- [BUG] plotters-canvas build error
- plotters v0.3.5 has RUSTSEC-2023-0020 from font-kit v0.11.0 HOT 2
- [BUG] titled function draw text position error when generating PNG file HOT 3
- [BUG] unsafe preconditions violated HOT 12
- default font size?
- [BUG] Spacing between words removed HOT 1
- Step charts
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plotters.