From f1a685f13bb2c966998559c6d50aa25003c1e07e Mon Sep 17 00:00:00 2001 From: Bauke Date: Wed, 7 Jun 2023 20:19:45 +0200 Subject: [PATCH] Add an option for point circle rendering. --- source/charts/mod.rs | 11 ++++++++++- source/cli/run.rs | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/source/charts/mod.rs b/source/charts/mod.rs index 174f5e7..47d48e1 100644 --- a/source/charts/mod.rs +++ b/source/charts/mod.rs @@ -27,6 +27,7 @@ impl UserCountChart { &self, parent: &PathBuf, group_name: &str, + render_point_circles: bool, ) -> Result { let parent = parent.join("charts/user-count"); create_dir_all(&parent).await?; @@ -102,7 +103,15 @@ impl UserCountChart { &ACCENT_1, &|(x, y), size, style| { EmptyElement::at((x, y)) - + Circle::new((0, 0), size, style.filled()) + + Circle::new( + (0, 0), + size, + if render_point_circles { + style.filled() + } else { + TRANSPARENT.filled() + }, + ) + Text::new( { if (x - 1) % 2 != 0 { diff --git a/source/cli/run.rs b/source/cli/run.rs index da3edb5..67d848c 100644 --- a/source/cli/run.rs +++ b/source/cli/run.rs @@ -115,7 +115,7 @@ pub async fn run() -> Result<()> { groups: GroupDataModel::get_n_most_recent(&db, 30, &group.name) .await?, } - .render(&output, &group.name) + .render(&output, &group.name, true) .await?; }