Skip to content

Commit

Permalink
Added if condition for NaN
Browse files Browse the repository at this point in the history
  • Loading branch information
Pedrito Colomina committed Aug 6, 2024
1 parent 8f212ec commit 6e54653
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions simple-d3-heatmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,10 @@ class SimpleD3Heatmap {

// create a color depending on colorMode and minvalue/maxvalue and actual value
getColor(value) {
if (isNaN(value)) {
// white
return "rgb(255, 255, 255)";
}
if (value === 0){
return "rgb(76, 175, 80)"
// verde
Expand Down

0 comments on commit 6e54653

Please sign in to comment.