Skip to content

Commit f81a195

Browse files
committed
fix main README
Signed-off-by: Andrei Gherghescu <8067229+andrei-ng@users.noreply.github.com>
1 parent 1518362 commit f81a195

File tree

4 files changed

+47
-39
lines changed

4 files changed

+47
-39
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@ All notable changes to this project will be documented in this file.
33

44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
55

6-
## [0.13.3] - 2025-xx-xx
6+
## [0.13.4] - 2025-07-17
77

88
### Fixed
99

10+
- [[#340](https://github.com/plotly/plotly.rs/pull/340)] Fix documentation related to `wasm` support
11+
1012
### Changed
13+
- [[#339](https://github.com/plotly/plotly.rs/pull/339)] Replace default Windows app with `explorer`
1114

1215
## [0.13.3] - 2025-07-12
1316

README.md

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@
3939

4040
* [Introduction](#introduction)
4141
* [Basic Usage](#basic-usage)
42-
* [Exporting an Interactive Plot](#exporting-an-interactive-plot)
43-
* [Exporting Static Images with Kaleido](#exporting-static-images-with-kaleido)
44-
* [Usage Within a Wasm Environment](#usage-within-a-wasm-environment)
42+
* [Exporting a single Interactive Plot](#exporting-a-single-interactive-plot)
43+
* [Exporting Static Images with plotly_static (Recommended)](#exporting-static-images-with-plotly_static-recommended)
44+
* [Exporting Static Images with Kaleido (legacy)](#exporting-static-images-with-kaleido-legacy)
45+
* [Usage Within a WASM Environment](#usage-within-a-wasm-environment)
4546
* [Crate Feature Flags](#crate-feature-flags)
4647
* [Contributing](#contributing)
4748
* [Code of Conduct](#code-of-conduct)
@@ -95,18 +96,6 @@ If you only want to view the plot in the browser quickly, use the `Plot.show()`
9596
plot.show(); // The default web browser will open, displaying an interactive plot
9697
```
9798

98-
## Exporting Static Images with Kaleido
99-
100-
To save a plot as a static image, the `kaleido` feature is required as well as installing an **external dependency**.
101-
102-
### Kaleido external dependency
103-
104-
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.
105-
106-
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.
107-
108-
Kaleido binaries are available on Github [release page](https://github.com/plotly/Kaleido/releases). It currently supports Linux(`x86_64`), Windows(`x86_64`) and MacOS(`x86_64`/`aarch64`).
109-
11099
## Exporting Static Images with plotly_static (Recommended)
111100

112101
The recommended way to export static images is using the `plotly_static` backend, which uses a headless browser via WebDriver (Chrome or Firefox) for rendering. This is available via the `static_export_default` feature:
@@ -132,7 +121,7 @@ let svg_string = plot.to_svg(800, 600, 1.0)?;
132121

133122
**Note:** This feature requires a WebDriver-compatible browser (Chrome or Firefox) as well as a Webdriver (chromedriver/geckodriver) to be available on the system. For advanced usage, see the [`plotly_static` crate documentation](https://docs.rs/plotly_static/).
134123

135-
## Exporting Static Images with Kaleido (to be deprecated)
124+
## Exporting Static Images with Kaleido (legacy)
136125

137126
Enable the `kaleido` feature and opt in for automatic downloading of the `kaleido` binaries by doing the following
138127

@@ -165,9 +154,17 @@ plot.add_trace(trace);
165154
plot.write_image("out.png", ImageFormat::PNG, 800, 600, 1.0);
166155
```
167156

168-
## Usage Within a Wasm Environment
157+
### Kaleido external dependency
158+
159+
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.
160+
161+
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.
162+
163+
Kaleido binaries are available on Github [release page](https://github.com/plotly/Kaleido/releases). It currently supports Linux(`x86_64`), Windows(`x86_64`) and MacOS(`x86_64`/`aarch64`).
164+
165+
## Usage Within a WASM Environment
169166

170-
`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 environments and will throw a compilation error if enabled.
167+
`Plotly.rs` can be used with a WASM-based frontend framework. The needed dependencies are automatically enabled for `wasm32` targets at compile time and there is no longer a need for the custom `wasm` flag in this crate. Note that the `kaleido` and `plotly_static` features are not supported in WASM environments and will throw a compilation error if enabled.
171168

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

@@ -190,7 +187,6 @@ A simple `Plot` component would look as follows, using `Yew` as an example front
190187
use plotly::{Plot, Scatter};
191188
use yew::prelude::*;
192189

193-
194190
#[function_component(PlotComponent)]
195191
pub fn plot_component() -> Html {
196192
let p = yew_hooks::use_async::<_, _, ()>({
@@ -218,22 +214,23 @@ pub fn plot_component() -> Html {
218214
}
219215
```
220216

221-
More detailed standalone examples can be found in the [examples/](https://github.com/plotly/plotly.rs/tree/main/examples) directory.
217+
More detailed standalone examples can be found in the [examples/wasm-yew](https://github.com/plotly/plotly.rs/tree/main/examples/wasm-yew) directory.
222218

223219
# Crate Feature Flags
224220

225221
The following feature flags are available:
226222

227-
### `kaleido`
223+
### `static_export_default`
228224

229-
Adds plot save functionality to the following formats: `png`, `jpeg`, `webp`, `svg`, `pdf` and `eps`.
225+
Since version `0.13.0` support for exporting to static images is based on using a new crate called `plotly_static` that uses WebDriver and browser automation for static export functionality.
230226

231-
Requires `Kaleido` to have been previously installed on the host machine. See the following feature flag and [Kaleido external dependency](#kaleido-external-dependency).
227+
This feature flag automatically enables the usage of the `plotly_static` dependency as well as the `chromedriver` and `webdriver_download` features of that crate. For more details about these feature flags, refer to the `plotly_static` [documentation](plotly_static/README.md).
232228

233-
### `kaleido_download`
229+
The other related features allow controlling other aspects of the `plotly_static` crate
230+
- `static_export_chromedriver`
231+
- `static_export_geckodriver`
232+
- `static_export_wd_download`
234233

235-
Enable download and install of Kaleido binary at build time from [Kaleido releases](https://github.com/plotly/Kaleido/releases/) on the host machine.
236-
See [Kaleido external dependency](#kaleido-external-dependency) for more details.
237234

238235
### `plotly_image`
239236

@@ -253,9 +250,16 @@ When the feature is enabled, users can still opt in for the CDN version by using
253250

254251
Note that when using `Plot::to_inline_html()`, it is assumed that the `plotly.js` library is already in scope within the HTML file, so enabling this feature flag will have no effect.
255252

256-
### `wasm`
253+
### `kaleido` (legacy)
257254

258-
Enables compilation for the `wasm32-unknown-unknown` target and provides access to a `bindings` module containing wrappers around functions exported by the plotly.js library.
255+
Adds plot save functionality to the following formats: `png`, `jpeg`, `webp`, `svg`, `pdf` and `eps`.
256+
257+
Requires `Kaleido` to have been previously installed on the host machine. See the following feature flag and [Kaleido external dependency](#kaleido-external-dependency).
258+
259+
### `kaleido_download` (legacy)
260+
261+
Enable download and install of Kaleido binary at build time from [Kaleido releases](https://github.com/plotly/Kaleido/releases/) on the host machine.
262+
See [Kaleido external dependency](#kaleido-external-dependency) for more details.
259263

260264
# Contributing
261265

plotly/Cargo.toml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "plotly"
3-
version = "0.13.3"
3+
version = "0.13.4"
44
description = "A plotting library powered by Plotly.js"
55
authors = [
66
"Ioannis Giagkiozis <i.giagkiozis@gmail.com>",
@@ -17,11 +17,6 @@ keywords = ["plot", "chart", "plotly"]
1717
exclude = ["target/*"]
1818

1919
[features]
20-
# DEPRECATED: kaleido feature will be removed in version 0.14.0. Use `static_export_*` features instead.
21-
kaleido = ["plotly_kaleido"]
22-
# DEPRECATED: kaleido_download feature will be removed in version 0.14.0. Use `static_export_wd_download` instead.
23-
kaleido_download = ["plotly_kaleido/download"]
24-
2520
static_export_chromedriver = ["plotly_static", "plotly_static/chromedriver"]
2621
static_export_geckodriver = ["plotly_static", "plotly_static/geckodriver"]
2722
static_export_wd_download = ["plotly_static/webdriver_download"]
@@ -31,6 +26,10 @@ static_export_default = [
3126
"plotly_static/webdriver_download",
3227
]
3328

29+
plotly_ndarray = ["ndarray"]
30+
plotly_image = ["image"]
31+
plotly_embed_js = []
32+
3433
# All non-conflicting features
3534
all = [
3635
"plotly_ndarray",
@@ -41,9 +40,11 @@ all = [
4140
# This is used for enabling extra debugging messages and debugging functionality
4241
debug = ["plotly_static?/debug"]
4342

44-
plotly_ndarray = ["ndarray"]
45-
plotly_image = ["image"]
46-
plotly_embed_js = []
43+
# DEPRECATED: kaleido feature will be removed in version 0.14.0. Use `static_export_*` features instead.
44+
kaleido = ["plotly_kaleido"]
45+
# DEPRECATED: kaleido_download feature will be removed in version 0.14.0. Use `static_export_wd_download` instead.
46+
kaleido_download = ["plotly_kaleido/download"]
47+
4748

4849
[dependencies]
4950
askama = { version = "0.14.0", features = ["serde_json"] }

plotly_kaleido/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "plotly_kaleido"
3-
version = "0.13.3"
3+
version = "0.13.4"
44
description = "Additional output format support for plotly using Kaleido"
55
authors = [
66
"Ioannis Giagkiozis <i.giagkiozis@gmail.com>",

0 commit comments

Comments
 (0)