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
This adds a new `plotly_noembed` feature that can be used to reduce the
sizes of binaries by not embedding `plotly.min.js`.
Since askama can not handle compile-time flags, we had to duplicate the
`plot.html` and `static_plot.html` templates, where the new
`*_noembed.html` version only contains the CDN-variant.
The `use_local_plotly` option has been feature-gated such that it is
not available when using the new feature.
I verified that this works by building an application that depends on
plotly.rs (including optimization and LTO in all cases):
no plotly: 4.96 MiB (5,201,920 bytes)
master: 8.96 MiB (9,400,320 bytes)
this branch: 5.44 MiB (5,701,632 bytes)
The difference between this branch and master is 3,698,688 bytes, which
is very close to the size of `plotly.min.js` (3,686,400 bytes). Just as
expected.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,10 @@ 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.10.0] - 2024-xx-xx
7
+
### Added
8
+
-[[#231](https://github.com/plotly/plotly.rs/pull/231)] Added new `plotly_noembed` feature to reduce binary sizes by not embedding `plotly.min.js`.
9
+
6
10
## [0.9.1] - 2024-09-06
7
11
### Added
8
12
-[[#217](https://github.com/plotly/plotly.rs/pull/217)] Added show_html(filename) method to bypass situations where accessing default `/tmp` is not possible, e.g., with in SNAP Firefox
Copy file name to clipboardExpand all lines: README.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -201,6 +201,11 @@ Adds trait implementations so that `image::RgbImage` and `image::RgbaImage` can
201
201
202
202
Adds support for creating plots directly using [ndarray](https://github.com/rust-ndarray/ndarray) types.
203
203
204
+
### `plotly_noembed`
205
+
206
+
This feature can be used to reduce the binary size by not embedding `plotly.min.js`. This requires the use of the CDN version,
207
+
and disables the `use_local_plotly` method.
208
+
204
209
### `wasm`
205
210
206
211
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.
0 commit comments