From 1cd49ecdfc562241d70d1bd2948063a7b63e5b89 Mon Sep 17 00:00:00 2001 From: Nickolas Fotopoulos Date: Thu, 26 Sep 2024 22:42:48 -0700 Subject: [PATCH 1/6] Fix Pie::new() doctest; did not compile --- plotters/src/element/pie.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plotters/src/element/pie.rs b/plotters/src/element/pie.rs index 7994d2f5..efc828f2 100644 --- a/plotters/src/element/pie.rs +++ b/plotters/src/element/pie.rs @@ -69,7 +69,8 @@ impl<'a, Label: Display> Pie<'a, (i32, i32), Label> { /// Default is set to start at 0, which is aligned on the x axis. /// ``` /// use plotters::prelude::*; - /// let mut pie = Pie::new(&(50,50), &10.0, &[50.0, 25.25, 20.0, 5.5], &[RED.to_rgba(), BLUE.to_rgba(), GREEN.to_rgba(), WHITE.to_rgba()], &["Red", "Blue", "Green", "White"]); + /// let colors = [RED.to_rgba(), BLUE.to_rgba(), GREEN.to_rgba(), WHITE.to_rgba()]; + /// let mut pie = Pie::new(&(50,50), &10.0, &[50.0, 25.25, 20.0, 5.5], &colors, &["Red", "Blue", "Green", "White"]); /// pie.start_angle(-90.0); // retract to a right angle, so it starts aligned to a vertical Y axis. /// ``` pub fn start_angle(&mut self, start_angle: f64) { From 65de1078cc5ddc54748f4ababc14c37d61682785 Mon Sep 17 00:00:00 2001 From: Nickolas Fotopoulos Date: Wed, 25 Sep 2024 22:22:55 -0700 Subject: [PATCH 2/6] Fix "histogram" feature to be all_series rather than all_elements --- plotters/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plotters/Cargo.toml b/plotters/Cargo.toml index 053af3dd..14df9698 100644 --- a/plotters/Cargo.toml +++ b/plotters/Cargo.toml @@ -66,8 +66,8 @@ default = [ "deprecated_items", "all_series", "all_elements", "full_palette" ] -all_series = ["area_series", "line_series", "point_series", "surface_series"] -all_elements = ["errorbar", "candlestick", "boxplot", "histogram"] +all_series = ["area_series", "line_series", "point_series", "surface_series", "histogram"] +all_elements = ["errorbar", "candlestick", "boxplot"] # Tier 1 Backends bitmap_backend = ["plotters-bitmap", "ttf"] From edd467cfda6f5dbb67ace70aac7a8adffee61b05 Mon Sep 17 00:00:00 2001 From: Nickolas Fotopoulos Date: Fri, 27 Sep 2024 21:45:08 -0700 Subject: [PATCH 3/6] Fix CI failures and cargo test by bumping font-kit version --- plotters/Cargo.toml | 47 ++++++++++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/plotters/Cargo.toml b/plotters/Cargo.toml index 14df9698..4489f0ed 100644 --- a/plotters/Cargo.toml +++ b/plotters/Cargo.toml @@ -32,7 +32,7 @@ path = "../plotters-svg" ttf-parser = { version = "0.15.0", optional = true } lazy_static = { version = "1.4.0", optional = true } pathfinder_geometry = { version = "0.5.1", optional = true } -font-kit = { version = "0.11.0", optional = true } +font-kit = { version = "0.14.2", optional = true } [target.'cfg(not(all(target_arch = "wasm32", not(target_os = "wasi"))))'.dependencies.image] version = "0.24.2" @@ -46,27 +46,37 @@ version = "0.2.62" [target.'cfg(all(target_arch = "wasm32", not(target_os = "wasi")))'.dependencies.web-sys] version = "0.3.51" features = [ - "Document", - "DomRect", - "Element", - "HtmlElement", - "Node", - "Window", - "HtmlCanvasElement", - "CanvasRenderingContext2d", + "Document", + "DomRect", + "Element", + "HtmlElement", + "Node", + "Window", + "HtmlCanvasElement", + "CanvasRenderingContext2d", ] [features] default = [ - "bitmap_backend", "bitmap_encoder", "bitmap_gif", - "svg_backend", - "chrono", - "ttf", - "image", - "deprecated_items", "all_series", "all_elements", - "full_palette" + "bitmap_backend", + "bitmap_encoder", + "bitmap_gif", + "svg_backend", + "chrono", + "ttf", + "image", + "deprecated_items", + "all_series", + "all_elements", + "full_palette", +] +all_series = [ + "area_series", + "line_series", + "point_series", + "surface_series", + "histogram", ] -all_series = ["area_series", "line_series", "point_series", "surface_series", "histogram"] all_elements = ["errorbar", "candlestick", "boxplot"] # Tier 1 Backends @@ -99,7 +109,8 @@ fontconfig-dlopen = ["font-kit/source-fontconfig-dlopen"] # Misc datetime = ["chrono"] evcxr = ["svg_backend"] -deprecated_items = [] # Keep some of the deprecated items for backward compatibility +deprecated_items = [ +] # Keep some of the deprecated items for backward compatibility [dev-dependencies] itertools = "0.10.0" From 90ebcf38dff76b9f9e577b29348e48bdb512dc46 Mon Sep 17 00:00:00 2001 From: Nickolas Fotopoulos Date: Sat, 28 Sep 2024 00:45:50 -0700 Subject: [PATCH 4/6] Update CI workflows from master --- .github/dependabot.yml | 4 ++++ .github/workflows/plotters-backend.yml | 2 +- .github/workflows/plotters-bitmap.yml | 2 +- .github/workflows/plotters-core.yml | 12 ++++++------ .github/workflows/plotters-svg.yml | 2 +- .github/workflows/rust-clippy.yml | 4 ++-- .github/workflows/wasm.yml | 2 +- 7 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f989eef4..a8fdcc59 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -14,3 +14,7 @@ updates: - dependency-name: gif versions: - 0.11.1 +- package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" diff --git a/.github/workflows/plotters-backend.yml b/.github/workflows/plotters-backend.yml index e6a5e37d..556f39b8 100644 --- a/.github/workflows/plotters-backend.yml +++ b/.github/workflows/plotters-backend.yml @@ -9,7 +9,7 @@ jobs: matrix: os: [ubuntu-latest, windows-latest, macos-latest] steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 with: submodules: recursive - uses: actions-rs/toolchain@v1 diff --git a/.github/workflows/plotters-bitmap.yml b/.github/workflows/plotters-bitmap.yml index 6cb86b02..79b4f259 100644 --- a/.github/workflows/plotters-bitmap.yml +++ b/.github/workflows/plotters-bitmap.yml @@ -9,7 +9,7 @@ jobs: matrix: os: [ubuntu-latest, windows-latest, macos-latest] steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 with: submodules: recursive - uses: actions-rs/toolchain@v1 diff --git a/.github/workflows/plotters-core.yml b/.github/workflows/plotters-core.yml index 2f53410a..1e9a952c 100644 --- a/.github/workflows/plotters-core.yml +++ b/.github/workflows/plotters-core.yml @@ -7,7 +7,7 @@ jobs: name: cargo-doc runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: actions-rs/toolchain@v1 with: profile: minimal @@ -20,7 +20,7 @@ jobs: msrv: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 with: submodules: recursive - uses: actions-rs/toolchain@v1 @@ -34,7 +34,7 @@ jobs: matrix: os: [ubuntu-latest, windows-latest, macos-latest] steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 with: submodules: recursive - uses: actions-rs/toolchain@v1 @@ -52,7 +52,7 @@ jobs: test_all_features: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 with: submodules: recursive - uses: actions-rs/toolchain@v1 @@ -66,7 +66,7 @@ jobs: run_all_examples: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 with: submodules: recursive - uses: actions-rs/cargo@v1 @@ -81,7 +81,7 @@ jobs: ../target/release/examples/$(basename ${example} .rs) done tar -czvf example-outputs.tar.gz plotters-doc-data - - uses: actions/upload-artifact@v1 + - uses: actions/upload-artifact@v4 with: name: example-outputs path: plotters/example-outputs.tar.gz diff --git a/.github/workflows/plotters-svg.yml b/.github/workflows/plotters-svg.yml index d81e98f7..d44a400c 100644 --- a/.github/workflows/plotters-svg.yml +++ b/.github/workflows/plotters-svg.yml @@ -9,7 +9,7 @@ jobs: matrix: os: [ubuntu-latest, windows-latest, macos-latest] steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 with: submodules: recursive - uses: actions-rs/toolchain@v1 diff --git a/.github/workflows/rust-clippy.yml b/.github/workflows/rust-clippy.yml index ca1732c8..8536ab98 100644 --- a/.github/workflows/rust-clippy.yml +++ b/.github/workflows/rust-clippy.yml @@ -27,7 +27,7 @@ jobs: security-events: write steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install Rust toolchain uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af #@v1 @@ -48,7 +48,7 @@ jobs: continue-on-error: true - name: Upload analysis results to GitHub - uses: github/codeql-action/upload-sarif@v1 + uses: github/codeql-action/upload-sarif@v3 with: sarif_file: rust-clippy-results.sarif wait-for-processing: true diff --git a/.github/workflows/wasm.yml b/.github/workflows/wasm.yml index 35166ecc..e9ae4ad3 100644 --- a/.github/workflows/wasm.yml +++ b/.github/workflows/wasm.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 with: submodules: recursive - name: Install WASM tool chain From cb7188806ccf071fb5e3a2cf4b9d3a720914cf99 Mon Sep 17 00:00:00 2001 From: Nickolas Fotopoulos Date: Sun, 2 Mar 2025 20:15:42 -0800 Subject: [PATCH 5/6] Fix stock example --- plotters/examples/stock.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plotters/examples/stock.rs b/plotters/examples/stock.rs index 29939a69..4bfd8759 100644 --- a/plotters/examples/stock.rs +++ b/plotters/examples/stock.rs @@ -1,9 +1,7 @@ -use chrono::{DateTime, Duration, NaiveDate}; +use chrono::{Duration, NaiveDate}; use plotters::prelude::*; fn parse_time(t: &str) -> NaiveDate { - DateTime::parse_from_str(&format!("{} 0:0", t), "%Y-%m-%d %H:%M") - .unwrap() - .date_naive() + NaiveDate::parse_from_str(&format!("{} 0:0", t), "%Y-%m-%d %H:%M").unwrap() } const OUT_FILE_NAME: &'static str = "plotters-doc-data/stock.png"; fn main() -> Result<(), Box> { From 85c77f5fadc4cb63f5ea060c41b87ae2e9238d7a Mon Sep 17 00:00:00 2001 From: Nickolas Fotopoulos Date: Sun, 2 Mar 2025 22:46:33 -0800 Subject: [PATCH 6/6] Enable cross-compile of x86_64-unknown-linux-gnu from others --- Cross.toml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 Cross.toml diff --git a/Cross.toml b/Cross.toml new file mode 100644 index 00000000..6e7feccc --- /dev/null +++ b/Cross.toml @@ -0,0 +1,5 @@ +[target.x86_64-unknown-linux-gnu] +pre-build = [ + "apt-get update", + "apt-get install --assume-yes libfontconfig-dev:$CROSS_DEB_ARCH", +]