From e657753bf909bbe7f4a6248469b5357a461e8274 Mon Sep 17 00:00:00 2001 From: Andrei Gherghescu <8067229+andrei-ng@users.noreply.github.com> Date: Sat, 30 Nov 2024 11:02:58 +0100 Subject: [PATCH] bump plotly version and edition to 2021 - bump edition to 2021 - set resolver to 2 to bypasses latest wasm-bindgen bug: https://github.com/rustwasm/wasm-bindgen/issues/4304 - remove patch versioning from all dependencies Signed-off-by: Andrei Gherghescu <8067229+andrei-ng@users.noreply.github.com> --- CHANGELOG.md | 4 ++-- Cargo.toml | 7 ++---- README.md | 6 ++--- docs/book/src/fundamentals/ndarray_support.md | 2 +- docs/book/src/getting_started.md | 6 ++--- examples/3d_charts/Cargo.toml | 4 ++-- examples/Cargo.toml | 3 ++- examples/basic_charts/Cargo.toml | 6 ++--- examples/custom_controls/Cargo.toml | 4 ++-- examples/financial_charts/Cargo.toml | 4 ++-- examples/images/Cargo.toml | 7 ++++-- examples/ndarray/Cargo.toml | 2 +- examples/shapes/Cargo.toml | 6 ++--- examples/statistical_charts/Cargo.toml | 6 ++--- examples/wasm-yew-minimal/Cargo.toml | 11 +++++---- plotly/Cargo.toml | 24 +++++++++---------- plotly_derive/Cargo.toml | 4 ++-- plotly_kaleido/Cargo.toml | 10 ++++---- plotly_kaleido/src/lib.rs | 4 ++++ 19 files changed, 64 insertions(+), 56 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a39c706..8abd211e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file. 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). -## [0.11.0] - 2024-11-x +## [0.11.0] - 2024-11-30 ### Changed - [[#251](https://github.com/plotly/plotly.rs/pull/251)] Expose image data as String with `to_base64` and `to_svg` using Kaleido - [[#245](https://github.com/plotly/plotly.rs/pull/245)] Change Contours size to be `f64` instead of `usize` @@ -25,7 +25,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Fixed - [[#230](https://github.com/plotly/plotly.rs/pull/230)] Make Bar chart `width` and `offset` use `f64` values. -## [0.10.0] - 2024-09-06 +## [0.9.1] - 2024-09-06 ### Added - [[#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 - [[#227](https://github.com/plotly/plotly.rs/pull/227)] Switch from HTML template render from `askama` to `rinja` diff --git a/Cargo.toml b/Cargo.toml index b6aa8df4..5f2ceea2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,3 @@ [workspace] -members = [ - "plotly", - "plotly_derive", - "plotly_kaleido", -] \ No newline at end of file +resolver = "2" +members = ["plotly", "plotly_derive", "plotly_kaleido"] diff --git a/README.md b/README.md index b7d745bd..3eb81720 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ Add this to your `Cargo.toml`: ```toml [dependencies] -plotly = "0.10.0" +plotly = "0.11" ``` ## Exporting a single Interactive Plot @@ -103,7 +103,7 @@ To save a plot as a static image, the `kaleido` feature is required: # Cargo.toml [dependencies] -plotly = { version = "0.10.0", features = ["kaleido"] } +plotly = { version = "0.11", features = ["kaleido"] } ``` With this feature enabled, plots can be saved as any of `png`, `jpeg`, `webp`, `svg`, `pdf` and `eps`. Note that the plot will be a static image, i.e. they will be non-interactive. @@ -130,7 +130,7 @@ Using `Plotly.rs` in a Wasm-based frontend framework is possible by enabling the # Cargo.toml [dependencies] -plotly = { version = "0.10.0", features = ["wasm"] } +plotly = { version = "0.11", features = ["wasm"] } ``` First, make sure that you have the Plotly JavaScript library in your base HTML template: diff --git a/docs/book/src/fundamentals/ndarray_support.md b/docs/book/src/fundamentals/ndarray_support.md index cf258750..fc78dcd7 100644 --- a/docs/book/src/fundamentals/ndarray_support.md +++ b/docs/book/src/fundamentals/ndarray_support.md @@ -3,7 +3,7 @@ To enable [ndarray](https://github.com/rust-ndarray/ndarray) support in [Plotly.rs](https://github.com/plotly/plotly.rs) add the following feature to your `Cargo.toml` file: ```toml [dependencies] -plotly = { version = ">=0.7.0", features = ["plotly_ndarray"] } +plotly = { version = ">=0.7", features = ["plotly_ndarray"] } ``` This extends the [Plotly.rs](https://github.com/plotly/plotly.rs) API in two ways: diff --git a/docs/book/src/getting_started.md b/docs/book/src/getting_started.md index b3300536..0e1afce5 100644 --- a/docs/book/src/getting_started.md +++ b/docs/book/src/getting_started.md @@ -22,7 +22,7 @@ To start using [plotly.rs](https://github.com/plotly/plotly.rs) in your project ```toml [dependencies] -plotly = "0.10.0" +plotly = "0.11" ``` [Plotly.rs](https://github.com/plotly/plotly.rs) is ultimately a thin wrapper around the `plotly.js` library. The main job of this library is to provide `structs` and `enums` which get serialized to `json` and passed to the `plotly.js` library to actually do the heavy lifting. As such, if you are familiar with `plotly.js` or its derivatives (e.g. the equivalent Python library), then you should find [`plotly.rs`](https://github.com/plotly/plotly.rs) intuitive to use. @@ -97,7 +97,7 @@ To add the ability to save plots in the following formats: png, jpeg, webp, svg, ```toml [dependencies] -plotly = { version = "0.10.0", features = ["kaleido"] } +plotly = { version = "0.11", features = ["kaleido"] } ``` ## WebAssembly Support @@ -106,7 +106,7 @@ As of v0.8.0, [plotly.rs](https://github.com/plotly/plotly.rs) can now be used i ```toml [dependencies] -plotly = { version = ">=0.8.0" features = ["wasm"] } +plotly = { version = ">=0.8" features = ["wasm"] } ``` The `wasm` feature exposes rudimentary bindings to the `plotly.js` library, which can then be used in a `wasm` environment such as the [`Yew`](https://yew.rs/) frontend framework. diff --git a/examples/3d_charts/Cargo.toml b/examples/3d_charts/Cargo.toml index 78dcb9d5..fab9a60d 100644 --- a/examples/3d_charts/Cargo.toml +++ b/examples/3d_charts/Cargo.toml @@ -5,6 +5,6 @@ authors = ["Michael Freeborn "] edition = "2021" [dependencies] -ndarray = "0.16.0" -rand = "0.8.5" +ndarray = "0.16" +rand = "0.8" plotly = { path = "../../plotly" } diff --git a/examples/Cargo.toml b/examples/Cargo.toml index fb11e879..1e112635 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -1,3 +1,4 @@ [workspace] members = ["*"] -exclude = ["jupyter", "target"] \ No newline at end of file +resolver = "2" +exclude = ["jupyter", "target"] diff --git a/examples/basic_charts/Cargo.toml b/examples/basic_charts/Cargo.toml index 8cc479e6..54ffb5ee 100644 --- a/examples/basic_charts/Cargo.toml +++ b/examples/basic_charts/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Michael Freeborn "] edition = "2021" [dependencies] -ndarray = "0.16.0" +ndarray = "0.16" plotly = { path = "../../plotly" } -rand = "0.8.5" -rand_distr = "0.4.3" +rand = "0.8" +rand_distr = "0.4" diff --git a/examples/custom_controls/Cargo.toml b/examples/custom_controls/Cargo.toml index ffcb1423..4d70ff5d 100644 --- a/examples/custom_controls/Cargo.toml +++ b/examples/custom_controls/Cargo.toml @@ -5,5 +5,5 @@ authors = ["Michael Freeborn "] edition = "2021" [dependencies] -itertools = "0.10.3" -plotly = { path = "../../plotly" } \ No newline at end of file +itertools = "0.10" +plotly = { path = "../../plotly" } diff --git a/examples/financial_charts/Cargo.toml b/examples/financial_charts/Cargo.toml index e6dc4964..980fd5af 100644 --- a/examples/financial_charts/Cargo.toml +++ b/examples/financial_charts/Cargo.toml @@ -5,6 +5,6 @@ authors = ["Michael Freeborn "] edition = "2021" [dependencies] -csv = "1.1.6" +csv = "1.1" plotly = { path = "../../plotly" } -serde = "1.0.147" +serde = "1.0" diff --git a/examples/images/Cargo.toml b/examples/images/Cargo.toml index cda293ac..1fe4fb39 100644 --- a/examples/images/Cargo.toml +++ b/examples/images/Cargo.toml @@ -6,5 +6,8 @@ edition = "2021" [dependencies] image = "0.25" -ndarray = "0.16.0" -plotly = { path = "../../plotly", features = ["plotly_image", "plotly_ndarray"] } +ndarray = "0.16" +plotly = { path = "../../plotly", features = [ + "plotly_image", + "plotly_ndarray", +] } diff --git a/examples/ndarray/Cargo.toml b/examples/ndarray/Cargo.toml index 444ca9cd..6668428e 100644 --- a/examples/ndarray/Cargo.toml +++ b/examples/ndarray/Cargo.toml @@ -5,5 +5,5 @@ authors = ["Michael Freeborn "] edition = "2021" [dependencies] -ndarray = "0.16.0" +ndarray = "0.16" plotly = { path = "../../plotly", features = ["plotly_ndarray"] } diff --git a/examples/shapes/Cargo.toml b/examples/shapes/Cargo.toml index 74599e29..799fea60 100644 --- a/examples/shapes/Cargo.toml +++ b/examples/shapes/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Michael Freeborn "] edition = "2021" [dependencies] -ndarray = "0.16.0" +ndarray = "0.16" plotly = { path = "../../plotly" } -rand = "0.8.5" -rand_distr = "0.4.3" +rand = "0.8" +rand_distr = "0.4" diff --git a/examples/statistical_charts/Cargo.toml b/examples/statistical_charts/Cargo.toml index dc8b1f9f..b2b02c20 100644 --- a/examples/statistical_charts/Cargo.toml +++ b/examples/statistical_charts/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Michael Freeborn "] edition = "2021" [dependencies] -ndarray = "0.16.0" +ndarray = "0.16" plotly = { path = "../../plotly" } -rand = "0.8.5" -rand_distr = "0.4.3" +rand = "0.8" +rand_distr = "0.4" diff --git a/examples/wasm-yew-minimal/Cargo.toml b/examples/wasm-yew-minimal/Cargo.toml index cef3d180..bc4156ba 100644 --- a/examples/wasm-yew-minimal/Cargo.toml +++ b/examples/wasm-yew-minimal/Cargo.toml @@ -1,12 +1,15 @@ [package] name = "wasm-yew-minimal" version = "0.1.0" -authors = ["Michael Freeborn ", "Yuichi Nakamura "] +authors = [ + "Michael Freeborn ", + "Yuichi Nakamura ", +] edition = "2021" [dependencies] plotly = { path = "../../plotly", features = ["wasm"] } -yew = "0.21.0" -yew-hooks = "0.3.2" -log = "0.4.6" +yew = "0.21" +yew-hooks = "0.3" +log = "0.4" wasm-logger = "0.2" diff --git a/plotly/Cargo.toml b/plotly/Cargo.toml index 41867f34..3ba11657 100644 --- a/plotly/Cargo.toml +++ b/plotly/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "plotly" -version = "0.10.0" +version = "0.11.0" description = "A plotting library powered by Plotly.js" authors = ["Ioannis Giagkiozis "] license = "MIT" @@ -8,7 +8,7 @@ readme = "../README.md" homepage = "https://github.com/plotly/plotly.rs" documentation = "https://docs.rs/plotly" repository = "https://github.com/plotly/plotly.rs" -edition = "2018" +edition = "2021" keywords = ["plot", "chart", "plotly"] exclude = ["target/*"] @@ -24,18 +24,18 @@ with-axum = ["rinja/with-axum", "rinja_axum"] [dependencies] rinja = { version = "0.3", features = ["serde_json"] } -rinja_axum = { version = "0.3.0", optional = true } +rinja_axum = { version = "0.3", optional = true } dyn-clone = "1" erased-serde = "0.4" getrandom = { version = "0.2", features = ["js"], optional = true } image = { version = "0.25", optional = true } js-sys = { version = "0.3", optional = true } -plotly_derive = { version = "0.10.0", path = "../plotly_derive" } -plotly_kaleido = { version = "0.10.0", path = "../plotly_kaleido", optional = true } -ndarray = { version = "0.16.0", optional = true } +plotly_derive = { version = "0.11", path = "../plotly_derive" } +plotly_kaleido = { version = "0.11", path = "../plotly_kaleido", optional = true } +ndarray = { version = "0.16", optional = true } once_cell = "1" -serde = { version = "1.0.132", features = ["derive"] } -serde_json = "1.0.73" +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" serde_repr = "0.1" serde_with = ">=2, <4" rand = "0.8" @@ -43,11 +43,11 @@ wasm-bindgen = { version = "0.2", optional = true } wasm-bindgen-futures = { version = "0.4", optional = true } [dev-dependencies] -csv = "1.1.6" +csv = "1.1" image = "0.25" itertools = ">=0.10, <0.14" -itertools-num = "0.1.3" -ndarray = "0.16.0" -plotly_kaleido = { version = "0.10.0", path = "../plotly_kaleido" } +itertools-num = "0.1" +ndarray = "0.16" +plotly_kaleido = { version = "0.11", path = "../plotly_kaleido" } rand_distr = "0.4" base64 = "0.22" diff --git a/plotly_derive/Cargo.toml b/plotly_derive/Cargo.toml index 25814d2a..b744b0d9 100644 --- a/plotly_derive/Cargo.toml +++ b/plotly_derive/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "plotly_derive" -version = "0.10.0" +version = "0.11.0" description = "Internal proc macro crate for Plotly-rs." authors = ["Ioannis Giagkiozis "] license = "MIT" homepage = "https://github.com/plotly/plotly.rs" documentation = "https://docs.rs/plotly" repository = "https://github.com/plotly/plotly.rs" -edition = "2018" +edition = "2021" keywords = ["plot", "chart", "plotly"] [dependencies] diff --git a/plotly_kaleido/Cargo.toml b/plotly_kaleido/Cargo.toml index 544fde05..7e225564 100644 --- a/plotly_kaleido/Cargo.toml +++ b/plotly_kaleido/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "plotly_kaleido" -version = "0.10.0" +version = "0.11.0" description = "Additional output format support for plotly using Kaleido" authors = ["Ioannis Giagkiozis "] license = "MIT" @@ -9,16 +9,16 @@ workspace = ".." homepage = "https://github.com/plotly/plotly.rs" documentation = "https://docs.rs/plotly_kaleido" repository = "https://github.com/plotly/plotly.rs" -edition = "2018" +edition = "2021" keywords = ["plot", "chart", "plotly", "ndarray"] exclude = ["target/*", "kaleido/*", "examples/*"] [dependencies] -serde = { version = "1.0.132", features = ["derive"] } -serde_json = "1.0.73" +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" base64 = "0.22" -dunce = "1.0.2" +dunce = "1.0" directories = ">=4, <6" [build-dependencies] diff --git a/plotly_kaleido/src/lib.rs b/plotly_kaleido/src/lib.rs index 6b2fee7b..ee40e339 100644 --- a/plotly_kaleido/src/lib.rs +++ b/plotly_kaleido/src/lib.rs @@ -194,6 +194,10 @@ impl Kaleido { .spawn() .expect("failed to spawn Kaleido binary"); + process + .wait() + .expect("failed to wait on kaelido child process"); + { let plot_data = PlotData::new(plotly_data, format, width, height, scale).to_json(); let mut process_stdin = process.stdin.take().unwrap();