diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 261d3677..a60329ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,7 +92,8 @@ jobs: strategy: fail-fast: false matrix: - example: [ # missing jupyter + example: # missing jupyter + [ 3d_charts, basic_charts, custom_controls, @@ -103,7 +104,7 @@ jobs: ndarray, scientific_charts, shapes, - subplots + subplots, ] runs-on: ubuntu-latest steps: @@ -124,4 +125,3 @@ jobs: with: targets: wasm32-unknown-unknown - run: cd ${{ github.workspace }}/examples/${{ matrix.example }} && cargo build --target wasm32-unknown-unknown - diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a39c706..b27e40e8 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-12-06 ### 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` @@ -11,9 +11,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a Renamed `use_cdn_plotly` to `use_cdn_js`. ### Fixed -- [[#248]](https://github.com/plotly/plotly.rs/issues/248) Book recipes do not render graphs -- [[#247]](https://github.com/plotly/plotly.rs/issues/247) Add function to export image (with Kaleido) as a b64 string -- [[#246]](https://github.com/plotly/plotly.rs/pull/246) Expose pattern fill api for histograms and bar charts +- [[#248](https://github.com/plotly/plotly.rs/issues/248)] Book recipes do not render graphs +- [[#247](https://github.com/plotly/plotly.rs/issues/247)] Add function to export image (with Kaleido) as a b64 string +- [[#246](https://github.com/plotly/plotly.rs/pull/246)] Expose pattern fill api for histograms and bar charts - [[#244](https://github.com/plotly/plotly.rs/pull/244)] Fix swapped x and y in the examples. - [[#242](https://github.com/plotly/plotly.rs/issues/242)] Disable request for tex-svg.js file - [[#237](https://github.com/plotly/plotly.rs/issues/237)] Add Categorical Axis ordering. @@ -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..da1196c4 100644 --- a/docs/book/src/fundamentals/ndarray_support.md +++ b/docs/book/src/fundamentals/ndarray_support.md @@ -130,4 +130,4 @@ var data = [trace_0,trace_1,trace_2,trace_3,trace_4,trace_5,trace_6,trace_7,trac var layout = {}; Plotly.newPlot('multiple_ndarray_traces_over_rows', data, layout, {"responsive": true}); }; - \ No newline at end of file + diff --git a/docs/book/src/getting_started.md b/docs/book/src/getting_started.md index b3300536..9caf0b30 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 @@ -152,4 +152,4 @@ pub fn plot(props: &PlotProps) -> Html {
} } -``` \ No newline at end of file +``` 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/src/plot.rs b/plotly/src/plot.rs index 1bbaacb1..22478b97 100644 --- a/plotly/src/plot.rs +++ b/plotly/src/plot.rs @@ -859,8 +859,9 @@ mod tests { assert!(!image_svg.is_empty()); let expected = "012246810"; - // Limit the test to the first LEN characters - const LEN: usize = 100; + // Limit the test to the first LEN characters as generated SVGs + // seem to contain uniquely generated IDs + const LEN: usize = 10; assert_eq!(expected[..LEN], image_svg[..LEN]); } } 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..09e0759a 100644 --- a/plotly_kaleido/src/lib.rs +++ b/plotly_kaleido/src/lib.rs @@ -177,6 +177,7 @@ impl Kaleido { let p = p.to_str().unwrap(); let p = String::from(p); + #[allow(clippy::zombie_processes)] let mut process = Command::new(p.as_str()) .current_dir(self.cmd_path.parent().unwrap()) .args([