From 047fede4e336fdc5a7c1023bd3951e4af98fe87e Mon Sep 17 00:00:00 2001 From: Splines Date: Fri, 22 Mar 2024 11:16:04 +0100 Subject: [PATCH] Fix amplitude of heatmap if no annotations are present --- app/assets/javascripts/thyme/heatmap.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/thyme/heatmap.js b/app/assets/javascripts/thyme/heatmap.js index de6a47866..2bf0ed887 100644 --- a/app/assets/javascripts/thyme/heatmap.js +++ b/app/assets/javascripts/thyme/heatmap.js @@ -69,8 +69,8 @@ class Heatmap { } } } - const maxValue = Math.max.apply(Math, pixelsAll); - const amplitude = maxHeight * (1 / maxValue); + const maxValue = Math.max(...pixelsAll); + const amplitude = maxValue != 0 ? maxHeight * (1 / maxValue) : 0; /* Construct heatmap SVG