Skip to content

Commit 833af05

Browse files
authored
update readme to remove mention of wasm feature flag (#278)
Signed-off-by: Andrei Gherghescu <[email protected]>
1 parent e80f837 commit 833af05

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

README.md

+2-9
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ To save a plot as a static image, the `kaleido` feature is required as well as i
102102

103103
### Kaleido external dependency
104104

105-
When developing applications for your host, enabling both `kaleido` and `kaleido_download` features will ensure that the `kaleido` binary is downloaded for your system's architecture at compile time. After download, it is unpacked into a specific path, e.g., on Linux this is `/home/USERNAME/.config/kaleido`. With these two features enabled, static images can be exported as described in the next section as long as the application run on the same host where where this crate was compiled on.
105+
When developing applications for your host, enabling both `kaleido` and `kaleido_download` features will ensure that the `kaleido` binary is downloaded for your system's architecture at compile time. After download, it is unpacked into a specific path, e.g., on Linux this is `/home/USERNAME/.config/kaleido`. With these two features enabled, static images can be exported as described in the next section as long as the application runs on the same machine where it has been compiled on.
106106

107107
When the applications developed with `plotly.rs` are intended for other targets or when the user wants to control where the `kaleido` binary is installed then Kaleido must be manually downloaded and installed. Setting the environment variable `KALEIDO_PATH=/path/installed/kaleido/` will ensure that applications that were built with the `kaleido` feature enabled can locate the `kaleido` executable and use it to generate static images.
108108

@@ -143,14 +143,7 @@ plot.write_image("out.png", ImageFormat::PNG, 800, 600, 1.0);
143143

144144
## Usage Within a Wasm Environment
145145

146-
Using `Plotly.rs` in a Wasm-based frontend framework is possible by enabling the `wasm` feature:
147-
148-
```toml
149-
# Cargo.toml
150-
151-
[dependencies]
152-
plotly = { version = "0.12", features = ["wasm"] }
153-
```
146+
`Plotly.rs` can be used with a Wasm-based frontend framework. The needed dependencies are automatically enabled on `wasm32` targets. Note that the `kaleido` feature is not supported in Wasm enviroments and will throw a compilation error if enabled.
154147

155148
First, make sure that you have the Plotly JavaScript library in your base HTML template:
156149

plotly_kaleido/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
//! Note that [plotly/Kaleido](https://github.com/plotly/Kaleido) is still in pre-release and as such the `kaleido`
1111
//! feature should be considered in pre-release mode as well.
1212
13+
#![cfg(not(target_family = "wasm"))]
1314
use std::fs::File;
1415
use std::io::prelude::*;
1516
use std::io::BufReader;

0 commit comments

Comments
 (0)