From 68edf5db4a96c6b66808257e21e2d59c77f14f6a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Sep 2026 03:05:10 +0000 Subject: [PATCH 1/3] build(deps): update dirs requirement from 6.0 to 7.0 Updates the requirements on dirs to permit the latest version. --- updated-dependencies: - dependency-name: dirs dependency-version: 7.0.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Signed-off-by: Andrei Gherghescu <8067229+andrei-ng@users.noreply.github.com> --- plotly_static/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plotly_static/Cargo.toml b/plotly_static/Cargo.toml index 953e21fd..9f32930b 100644 --- a/plotly_static/Cargo.toml +++ b/plotly_static/Cargo.toml @@ -40,7 +40,7 @@ clap = { version = "4.0", features = ["derive"] } [build-dependencies] tokio = { version = "1", features = ["full"] } anyhow = "1.0" -dirs = "6.0" +dirs = "7.0" zip = "8.0" webdriver-downloader = "0.17" From 666e47a270155f5a7e4ae6f207d1667164cc8613 Mon Sep 17 00:00:00 2001 From: Andrei Gherghescu <8067229+andrei-ng@users.noreply.github.com> Date: Sun, 22 Nov 2026 15:15:31 +0100 Subject: [PATCH 2/3] apply fmt Signed-off-by: Andrei Gherghescu <8067229+andrei-ng@users.noreply.github.com> --- examples/kaleido/src/main.rs | 4 ++-- examples/static_export/src/bin/sync.rs | 4 ++-- plotly/src/common/mod.rs | 4 ++-- plotly/src/configuration.rs | 4 ++-- plotly/src/layout/polar.rs | 4 ++-- plotly/src/lib.rs | 6 ++++-- plotly/src/plot.rs | 17 ++++++++++------- plotly/src/traces/violin.rs | 8 +++++--- plotly_derive/src/field_setter.rs | 7 ++++--- plotly_derive/src/lib.rs | 3 ++- plotly_kaleido/src/lib.rs | 16 ++++++++-------- plotly_static/src/lib.rs | 25 ++++++++++++++----------- plotly_static/src/template.rs | 3 ++- plotly_static/src/webdriver/launch.rs | 3 ++- 14 files changed, 61 insertions(+), 47 deletions(-) diff --git a/examples/kaleido/src/main.rs b/examples/kaleido/src/main.rs index de855bf7..4b08b194 100644 --- a/examples/kaleido/src/main.rs +++ b/examples/kaleido/src/main.rs @@ -14,8 +14,8 @@ fn main() { std::fs::create_dir_all("./output").unwrap(); let filename = "./output/inline_image".to_string(); - // The image will be saved to format!("output/image.{image_format}") relative to - // the current working directory. + // The image will be saved to format!("output/image.{image_format}") + // relative to the current working directory. #[allow(deprecated)] { plot.write_image(&filename, ImageFormat::EPS, width, height, scale); diff --git a/examples/static_export/src/bin/sync.rs b/examples/static_export/src/bin/sync.rs index 8cb93a98..950bca0f 100644 --- a/examples/static_export/src/bin/sync.rs +++ b/examples/static_export/src/bin/sync.rs @@ -42,8 +42,8 @@ fn main() -> Result<(), Box> { .expect("Failed to create StaticExporter"); info!("Exporting multiple plots using a single StaticExporter..."); - // Export all plots using the same exporter (new unified naming via extension - // trait) + // Export all plots using the same exporter (new unified naming via + // extension trait) exporter.write_image( &plot1, "./output/plot1_new_api", diff --git a/plotly/src/common/mod.rs b/plotly/src/common/mod.rs index 5b0e8375..2639285e 100644 --- a/plotly/src/common/mod.rs +++ b/plotly/src/common/mod.rs @@ -1177,8 +1177,8 @@ mod tests { #[test] fn serialize_direction() { - // TODO: I think `Direction` would be better as a struct, with `fillcolor` and - // `line` attributes + // TODO: I think `Direction` would be better as a struct, with + // `fillcolor` and `line` attributes let inc = Direction::Increasing { line: Line::new() }; let expected = json!({"line": {}}); assert_eq!(to_value(inc).unwrap(), expected); diff --git a/plotly/src/configuration.rs b/plotly/src/configuration.rs index f319e197..471b2340 100644 --- a/plotly/src/configuration.rs +++ b/plotly/src/configuration.rs @@ -150,8 +150,8 @@ pub enum PlotGLPixelRatio { #[serde(rename_all = "camelCase")] pub struct Configuration { // reference is here: https://github.com/plotly/plotly.js/blob/master/src/plot_api/plot_config.js - // missing: edits, show_sources, mode_bar_buttons, set_background, logging, notify_on_logging, - // global_transforms, mode_bar_buttons_to_add and locales + // missing: edits, show_sources, mode_bar_buttons, set_background, logging, + // notify_on_logging, global_transforms, mode_bar_buttons_to_add and locales typeset_math: Option, autosizable: Option, scroll_zoom: Option, diff --git a/plotly/src/layout/polar.rs b/plotly/src/layout/polar.rs index d8e44ea8..4fc9d380 100644 --- a/plotly/src/layout/polar.rs +++ b/plotly/src/layout/polar.rs @@ -552,8 +552,8 @@ mod tests { use crate::Layout; // The focus of the test is serialization, so we test all options for - // [`LayoutPolar`], even though some of those options would normally be mutually - // exclusive. + // [`LayoutPolar`], even though some of those options would normally be + // mutually exclusive. #[test] fn serialize_layout_polar() { let ticks = PolarAxisTicks::new() diff --git a/plotly/src/lib.rs b/plotly/src/lib.rs index d40a09d0..69611a0e 100644 --- a/plotly/src/lib.rs +++ b/plotly/src/lib.rs @@ -7,7 +7,8 @@ //! The `kaleido` and `kaleido_download` features are deprecated since version //! 0.13.0 and will be removed in version 0.15.0. Please migrate to the //! `plotly_static` and `static_export_*` features instead. -#![recursion_limit = "256"] // lets us use a large serde_json::json! macro for testing crate::layout::Axis +#![recursion_limit = "256"] // lets us use a large serde_json::json! macro for + // testing crate::layout::Axis extern crate askama; extern crate rand; extern crate serde; @@ -58,7 +59,8 @@ pub use common::color; pub use configuration::Configuration; pub use layout::Layout; pub use plot::{Plot, Trace, Traces}; -// Also provide easy access to modules which contain additional trace-specific types +// Also provide easy access to modules which contain additional trace-specific +// types pub use traces::{ box_plot, choropleth, choropleth_map, contour, density_map, funnel, heat_map, histogram, histogram2d, icicle, image, indicator, mesh3d, parcats, sankey, scatter, scatter3d, diff --git a/plotly/src/plot.rs b/plotly/src/plot.rs index 32cd770b..aa6be53f 100644 --- a/plotly/src/plot.rs +++ b/plotly/src/plot.rs @@ -298,7 +298,8 @@ impl Plot { file.flush().unwrap(); } - // Hand off the job of opening the browser to an OS-specific implementation. + // Hand off the job of opening the browser to an OS-specific + // implementation. Plot::show_with_default_app(temp_path); } @@ -311,7 +312,8 @@ impl Plot { pub fn show_html + std::clone::Clone>(&self, filename: P) { let path = filename.as_ref().to_str().unwrap(); self.write_html(filename.clone()); - // Hand off the job of opening the browser to an OS-specific implementation. + // Hand off the job of opening the browser to an OS-specific + // implementation. Plot::show_with_default_app(path); } @@ -342,7 +344,8 @@ impl Plot { file.flush().unwrap(); } - // Hand off the job of opening the browser to an OS-specific implementation. + // Hand off the job of opening the browser to an OS-specific + // implementation. Plot::show_with_default_app(temp_path); } @@ -739,8 +742,8 @@ impl Plot { /// This is used when the `plotly_embed_js` feature is enabled, providing /// self-contained HTML files that don't require external CDN resources. pub fn offline_js_sources() -> String { - // Note that since 'tex-mml-chtml' conflicts with 'tex-svg' when generating - // Latex Titles we no longer include it. + // Note that since 'tex-mml-chtml' conflicts with 'tex-svg' when + // generating Latex Titles we no longer include it. let local_tex_svg_js = include_str!("../resource/tex-svg-3.2.2.js"); let local_plotly_js = include_str!("../resource/plotly.min.js"); @@ -764,8 +767,8 @@ impl Plot { /// disabled, providing smaller HTML files that rely on external /// resources. pub fn online_cdn_js() -> String { - // Note that since 'tex-mml-chtml' conflicts with 'tex-svg' when generating - // Latex Titles we no longer include it. + // Note that since 'tex-mml-chtml' conflicts with 'tex-svg' when + // generating Latex Titles we no longer include it. r##" "## diff --git a/plotly/src/traces/violin.rs b/plotly/src/traces/violin.rs index 3d49357b..20dd903f 100644 --- a/plotly/src/traces/violin.rs +++ b/plotly/src/traces/violin.rs @@ -3,8 +3,9 @@ use plotly_derive::FieldSetter; use serde::{Serialize, Serializer}; -// Re-use the box plot's quartile method, whose values (linear/exclusive/inclusive) -// are identical to the violin trace's `quartilemethod` attribute. +// Re-use the box plot's quartile method, whose values +// (linear/exclusive/inclusive) are identical to the violin trace's +// `quartilemethod` attribute. pub use super::box_plot::QuartileMethod; use crate::{ color::Color, @@ -324,7 +325,8 @@ mod tests { let numeric = Violin::new(vec![1, 2, 3]).span(vec![0., 10.]); assert_eq!(to_value(numeric).unwrap()["span"], json!([0.0, 10.0])); - // Date/string span for date-valued axes (plotly.js types `span` as `any`). + // Date/string span for date-valued axes (plotly.js types `span` as + // `any`). let dated = Violin::new(vec![1, 2, 3]) .span_mode(SpanMode::Manual) .span(vec!["2020-01-01", "2020-12-31"]); diff --git a/plotly_derive/src/field_setter.rs b/plotly_derive/src/field_setter.rs index bcc87554..90037dba 100644 --- a/plotly_derive/src/field_setter.rs +++ b/plotly_derive/src/field_setter.rs @@ -509,8 +509,8 @@ impl FieldReceiver { _ => quote![], }; - // Optional matrix setter for Dim<_> when #[field_setter(with_matrix)] is - // present + // Optional matrix setter for Dim<_> when #[field_setter(with_matrix)] + // is present let matrix_setter = if self.with_matrix { let matrix_ident = Ident::new( &format!("{field_ident}_matrix"), @@ -541,7 +541,8 @@ impl FieldReceiver { #return_stmt } }, - // Generic matrix for other inner types that are already concrete (f64, enums, etc.) + // Generic matrix for other inner types that are already + // concrete (f64, enums, etc.) FieldType::OptionDimOther(inner_ty) => quote! { #field_docs pub fn #matrix_ident(mut self, value: Vec>) -> #return_ty { diff --git a/plotly_derive/src/lib.rs b/plotly_derive/src/lib.rs index e5111a73..93c879ab 100644 --- a/plotly_derive/src/lib.rs +++ b/plotly_derive/src/lib.rs @@ -30,7 +30,8 @@ pub fn layout_structs(_attr: TokenStream, item: TokenStream) -> TokenStream { #vis struct #template_struct_name #fields }; - // Generate Layout (with template field and #[field_setter(kind = "layout")]) + // Generate Layout (with template field and #[field_setter(kind = + // "layout")]) let layout_struct_name = format_ident!("Layout"); let mut layout_fields = fields.clone(); // Add the template field diff --git a/plotly_kaleido/src/lib.rs b/plotly_kaleido/src/lib.rs index 6f18b114..3c527378 100644 --- a/plotly_kaleido/src/lib.rs +++ b/plotly_kaleido/src/lib.rs @@ -116,8 +116,8 @@ struct PlotData<'a> { width: usize, height: usize, scale: f64, - // TODO: it would be great if this could be a plotly::Plot, but with the current workspace set - // up, that would be a cyclic dependency. + // TODO: it would be great if this could be a plotly::Plot, but with the + // current workspace set up, that would be a cyclic dependency. data: &'a Value, } @@ -259,8 +259,8 @@ impl Kaleido { let p = self.cmd_path.to_str().unwrap(); let format_str = format.to_string(); - // Removed flag 'disable-gpu' as it causes issues on MacOS and other platforms - // see Kaleido issue #323 + // Removed flag 'disable-gpu' as it causes issues on MacOS and other + // platforms see Kaleido issue #323 let cmd_args = vec![ "plotly", "--allow-file-access-from-files", @@ -303,10 +303,10 @@ impl Kaleido { let res = KaleidoResult::from(line.as_str()); if let Some(image_data) = res.result { // TODO: this should be refactored - // The assumption is that KaleidoResult contains a single image. - // We should end the loop on the first valid one. - // If that is not the case, prior implementation would have returned the last - // valid image + // The assumption is that KaleidoResult contains a single + // image. We should end the loop on the first valid one. + // If that is not the case, prior implementation would have + // returned the last valid image return Ok(image_data); } } diff --git a/plotly_static/src/lib.rs b/plotly_static/src/lib.rs index 347cdc1c..1e0467b2 100644 --- a/plotly_static/src/lib.rs +++ b/plotly_static/src/lib.rs @@ -1060,14 +1060,15 @@ impl AsyncStaticExporter { new_client }; - // For offline mode, write HTML to file to avoid data URI size limits since JS - // libraries are embedded in the file + // For offline mode, write HTML to file to avoid data URI size limits + // since JS libraries are embedded in the file let url = if self.offline_mode { let temp_file = template::to_file(html_content) .with_context(|| "Failed to create temporary HTML file")?; format!("file://{}", temp_file.to_string_lossy()) } else { - // For online mode, use data URI (smaller size since JS is loaded from CDN) + // For online mode, use data URI (smaller size since JS is loaded + // from CDN) format!("data:text/html,{}", encode(html_content)) }; @@ -1143,7 +1144,8 @@ impl AsyncStaticExporter { } #[cfg(any(feature = "chromedriver", feature = "geckodriver"))] { - // Define browser capabilities (copied to avoid reordering existing code) + // Define browser capabilities (copied to avoid reordering existing + // code) let mut caps = JsonMap::new(); let mut browser_opts = JsonMap::new(); let browser_args = self.webdriver_browser_caps.clone(); @@ -1373,8 +1375,8 @@ mod tests { PORT_COUNTER.fetch_add(1, Ordering::SeqCst) } - // In CI which may run on slow machines, we run a different strategy to generate - // the unique port. + // In CI which may run on slow machines, we run a different strategy to + // generate the unique port. #[cfg(feature = "debug")] fn get_unique_port() -> u32 { static PORT_COUNTER: AtomicU32 = AtomicU32::new(4844); @@ -1669,8 +1671,8 @@ mod tests { assert!(std::fs::remove_file(dst1.as_path()).is_ok()); exporter1.close(); - // Create second exporter on the same port - this should connect to existing - // WebDriver process (but create a new session) + // Create second exporter on the same port - this should connect to + // existing WebDriver process (but create a new session) let mut exporter2 = StaticExporterBuilder::default() .spawn_webdriver(true) .webdriver_port(test_port) @@ -1687,15 +1689,16 @@ mod tests { assert!(std::fs::remove_file(dst2.as_path()).is_ok()); exporter2.close(); - // Create third exporter on the same port - should also connect to existing - // WebDriver process + // Create third exporter on the same port - should also connect to + // existing WebDriver process let mut exporter3 = StaticExporterBuilder::default() .spawn_webdriver(true) .webdriver_port(test_port) .build() .unwrap(); - // Export third image using another new session on the same WebDriver process + // Export third image using another new session on the same WebDriver + // process let dst3 = PathBuf::from("process_reuse_3.png"); exporter3 .write_fig(dst3.as_path(), &test_plot, ImageFormat::PNG, 800, 600, 1.0) diff --git a/plotly_static/src/template.rs b/plotly_static/src/template.rs index 32e0b1cc..a3d9c1c0 100644 --- a/plotly_static/src/template.rs +++ b/plotly_static/src/template.rs @@ -256,7 +256,8 @@ pub(crate) fn to_file(data: &str) -> Result { fn offline_js_sources() -> String { // tex-mml-chtml conflicts with tex-svg when generating Latex Titles - // let local_tex_mml_js = include_str!("../resource/tex-mml-chtml-3.2.0.js"); + // let local_tex_mml_js = + // include_str!("../resource/tex-mml-chtml-3.2.0.js"); let local_plotly_js = include_str!("../resource/plotly.min.js"); let local_tex_svg_js = include_str!("../resource/tex-svg-3.2.2.js"); let local_html2pdf_js = include_str!("../resource/html2pdf.bundle.min.js"); diff --git a/plotly_static/src/webdriver/launch.rs b/plotly_static/src/webdriver/launch.rs index 600ce1c9..070b2299 100644 --- a/plotly_static/src/webdriver/launch.rs +++ b/plotly_static/src/webdriver/launch.rs @@ -172,7 +172,8 @@ impl WebDriver { } fn spawn_process(&self, driver_path: &Option, port: u32) -> Result { - let driver_path = driver_path.as_ref().unwrap(); // Safe unwrap since we validated above + let driver_path = driver_path.as_ref().unwrap(); // Safe unwrap since we + // validated above let mut command = Self::create_command(driver_path, port); Self::log_command(&command); From cb2b872b995ab7d320ccf971711709b84b33d2d0 Mon Sep 17 00:00:00 2001 From: Andrei Gherghescu <8067229+andrei-ng@users.noreply.github.com> Date: Sun, 22 Nov 2026 15:29:21 +0100 Subject: [PATCH 3/3] remove redundant homepage in cargo.toml Signed-off-by: Andrei Gherghescu <8067229+andrei-ng@users.noreply.github.com> --- plotly/Cargo.toml | 1 - plotly_derive/Cargo.toml | 1 - plotly_kaleido/Cargo.toml | 1 - plotly_static/Cargo.toml | 1 - 4 files changed, 4 deletions(-) diff --git a/plotly/Cargo.toml b/plotly/Cargo.toml index 723576fd..e0b68edd 100644 --- a/plotly/Cargo.toml +++ b/plotly/Cargo.toml @@ -8,7 +8,6 @@ authors = [ ] license = "MIT" readme = "../README.md" -homepage = "https://github.com/plotly/plotly.rs" documentation = "https://docs.rs/plotly" repository = "https://github.com/plotly/plotly.rs" edition = "2021" diff --git a/plotly_derive/Cargo.toml b/plotly_derive/Cargo.toml index cba1e240..4905504d 100644 --- a/plotly_derive/Cargo.toml +++ b/plotly_derive/Cargo.toml @@ -4,7 +4,6 @@ version = "0.14.1" 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 = "2021" diff --git a/plotly_kaleido/Cargo.toml b/plotly_kaleido/Cargo.toml index a935e3d7..30a1df7e 100644 --- a/plotly_kaleido/Cargo.toml +++ b/plotly_kaleido/Cargo.toml @@ -9,7 +9,6 @@ authors = [ license = "MIT" readme = "README.md" workspace = ".." -homepage = "https://github.com/plotly/plotly.rs" documentation = "https://docs.rs/plotly_kaleido" repository = "https://github.com/plotly/plotly.rs" edition = "2021" diff --git a/plotly_static/Cargo.toml b/plotly_static/Cargo.toml index 9f32930b..fc2f0181 100644 --- a/plotly_static/Cargo.toml +++ b/plotly_static/Cargo.toml @@ -5,7 +5,6 @@ description = "Export Plotly graphs to static images using WebDriver" authors = ["Andrei Gherghescu andrei-ng@protonmail.com"] license = "MIT" workspace = ".." -homepage = "https://github.com/plotly/plotly.rs" repository = "https://github.com/plotly/plotly.rs" edition = "2021" keywords = ["plotly", "static", "image", "export", "webdriver"]