Skip to content

Commit

Permalink
Fix amplitude of heatmap if no annotations are present
Browse files Browse the repository at this point in the history
  • Loading branch information
Splines committed Mar 22, 2024
1 parent 1d20ada commit 047fede
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/assets/javascripts/thyme/heatmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 047fede

Please sign in to comment.