Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix histogram feature grouping on next-release-devel #646

Open
wants to merge 6 commits into
base: next-release-devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ updates:
- dependency-name: gif
versions:
- 0.11.1
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
2 changes: 1 addition & 1 deletion .github/workflows/plotters-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/plotters-bitmap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/plotters-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/plotters-svg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/rust-clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions Cross.toml
Original file line number Diff line number Diff line change
@@ -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",
]
49 changes: 30 additions & 19 deletions plotters/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -46,28 +46,38 @@ 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"]
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"]
Expand Down Expand Up @@ -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"
Expand Down
6 changes: 2 additions & 4 deletions plotters/examples/stock.rs
Original file line number Diff line number Diff line change
@@ -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<dyn std::error::Error>> {
Expand Down
3 changes: 2 additions & 1 deletion plotters/src/element/pie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down