From 439697cfddae2424d3b311e689d1f4685384d50f Mon Sep 17 00:00:00 2001
From: Paolo Brasolin <paolo.brasolin@eurac.edu>
Date: Tue, 5 Apr 2022 14:48:21 +0200
Subject: [PATCH] feat: #be improve shot graph readability

---
 backend/public/dashboard.js | 2 +-
 backend/src/index.ts        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/backend/public/dashboard.js b/backend/public/dashboard.js
index cd9cd44..a774950 100644
--- a/backend/public/dashboard.js
+++ b/backend/public/dashboard.js
@@ -70,7 +70,7 @@ new Chart(document.getElementById("gamesByDateChart"), gamesByDateConfig);
 
 const shotsByDurationData = JSON.parse(
   document.getElementById("shotsByDurationData").textContent,
-);
+).filter((item) => item.bucket != null);
 
 const shotsByDurationConfig = {
   type: "bar",
diff --git a/backend/src/index.ts b/backend/src/index.ts
index e60436f..59ebc95 100644
--- a/backend/src/index.ts
+++ b/backend/src/index.ts
@@ -81,7 +81,7 @@ server.get("/", async (request, reply) => {
     .table("shots")
     .select(
       connection.raw(
-        "width_bucket(ended_at_gmtm - began_at_gmtm, 0, 60*1000, 60*10)*100 as bucket, count(*)",
+        "width_bucket(ended_at_gmtm - began_at_gmtm, 0, 60*1000, 60*5)*200 as bucket, count(*)",
       ),
     )
     .groupBy("bucket")
-- 
GitLab