You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -3,11 +3,14 @@ All notable changes to this project will be documented in this file.
3
3
4
4
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).
5
5
6
-
## [0.13.3] - 2025-xx-xx
6
+
## [0.13.4] - 2025-07-17
7
7
8
8
### Fixed
9
9
10
+
-[[#340](https://github.com/plotly/plotly.rs/pull/340)] Fix documentation related to `wasm` support
11
+
10
12
### Changed
13
+
-[[#339](https://github.com/plotly/plotly.rs/pull/339)] Replace default Windows app with `explorer`
Copy file name to clipboardExpand all lines: README.md
+32-28Lines changed: 32 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -39,9 +39,10 @@
39
39
40
40
*[Introduction](#introduction)
41
41
*[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)
45
46
*[Crate Feature Flags](#crate-feature-flags)
46
47
*[Contributing](#contributing)
47
48
*[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()`
95
96
plot.show(); // The default web browser will open, displaying an interactive plot
96
97
```
97
98
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
-
110
99
## Exporting Static Images with plotly_static (Recommended)
111
100
112
101
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)?;
132
121
133
122
**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/).
134
123
135
-
## Exporting Static Images with Kaleido (to be deprecated)
124
+
## Exporting Static Images with Kaleido (legacy)
136
125
137
126
Enable the `kaleido` feature and opt in for automatic downloading of the `kaleido` binaries by doing the following
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
169
166
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.
171
168
172
169
First, make sure that you have the Plotly JavaScript library in your base HTML template:
173
170
@@ -190,7 +187,6 @@ A simple `Plot` component would look as follows, using `Yew` as an example front
190
187
useplotly::{Plot, Scatter};
191
188
useyew::prelude::*;
192
189
193
-
194
190
#[function_component(PlotComponent)]
195
191
pubfnplot_component() ->Html {
196
192
letp=yew_hooks::use_async::<_, _, ()>({
@@ -218,22 +214,23 @@ pub fn plot_component() -> Html {
218
214
}
219
215
```
220
216
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.
222
218
223
219
# Crate Feature Flags
224
220
225
221
The following feature flags are available:
226
222
227
-
### `kaleido`
223
+
### `static_export_default`
228
224
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.
230
226
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).
232
228
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`
234
233
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.
237
234
238
235
### `plotly_image`
239
236
@@ -253,9 +250,16 @@ When the feature is enabled, users can still opt in for the CDN version by using
253
250
254
251
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.
255
252
256
-
### `wasm`
253
+
### `kaleido` (legacy)
257
254
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.
0 commit comments