From 480dbcdd1242b26c663f7ff7b52d75b45be711fc Mon Sep 17 00:00:00 2001 From: Pavel Perestoronin Date: Sun, 18 Jul 2021 14:26:32 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Highlight=20the=20win=20rate=20card?= =?UTF-8?q?=20too,=20closes=20#77?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/statistics.rs | 2 +- src/web/routes/player.rs | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c31b1907..520944b9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -235,7 +235,7 @@ dependencies = [ [[package]] name = "blitz-dashboard" -version = "0.10.1" +version = "0.10.2" dependencies = [ "anyhow", "chrono", diff --git a/Cargo.toml b/Cargo.toml index 73f14dee..942b8467 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "blitz-dashboard" -version = "0.10.1" +version = "0.10.2" authors = ["Pavel Perestoronin "] edition = "2018" resolver = "2" diff --git a/src/statistics.rs b/src/statistics.rs index 5f17463d..001b48f1 100644 --- a/src/statistics.rs +++ b/src/statistics.rs @@ -27,7 +27,7 @@ impl ConfidenceInterval { #[must_use] pub fn default_wilson_score_interval(n_trials: i32, n_successes: i32) -> Self { - Self::wilson_score_interval(n_trials, n_successes, Z_80) + Self::wilson_score_interval(n_trials, n_successes, Z_90) } #[must_use] diff --git a/src/web/routes/player.rs b/src/web/routes/player.rs index fd216abf..f940756d 100644 --- a/src/web/routes/player.rs +++ b/src/web/routes/player.rs @@ -278,11 +278,12 @@ pub async fn get( div.tile.is-ancestor { @if stats_delta.battles != 0 { div.tile."is-4".is-parent { + @let period_win_rate = ConfidenceInterval::default_wilson_score_interval(stats_delta.battles, stats_delta.wins); div.tile.is-child.card { header.card-header { p.card-header-title { (icon_text("fas fa-percentage", "Победы")) } } - div.card-content { + div.card-content.(partial_cmp_class(period_win_rate.partial_cmp(&total_win_rate))) { (render_confidence_interval_level(stats_delta.battles, stats_delta.wins)) } }