From 06d7724a7f496386cc3d5eda6193b94caa6458a8 Mon Sep 17 00:00:00 2001
From: p2312013 <amira.rabehi@etu.univ-lyon1.fr>
Date: Tue, 14 Jan 2025 07:33:07 +0100
Subject: [PATCH] fixed radial Visu

---
 static/js/main.js | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/static/js/main.js b/static/js/main.js
index fd1caf9..5461049 100644
--- a/static/js/main.js
+++ b/static/js/main.js
@@ -1515,7 +1515,14 @@ function renderRadialDistanceChart() {
             .endAngle((d) => x(d.week) + x.bandwidth())
             .padAngle(0.02)
             .padRadius(innerRadius))
-          .attr("fill", (d) => d[personKey] > 0 ? color(d[sleepKey]) : "#ccc")
+          
+          .attr("fill", (d) => {
+            if (d[personKey] <= 0 || d[sleepKey] <= 0 || d[sleepKey] === null || d[personKey] === null) {
+              return "#ccc"; // Couleur grise pour les valeurs nulles ou absentes
+            }
+            return color(d[sleepKey]); // Couleur selon la durée de sommeil
+          })
+          
           .on("mouseover", function (event, d) {
             tooltip.transition().duration(200).style("opacity", 0.9);
             tooltip.html(`
-- 
GitLab