Skip to content

Commit

Permalink
fix(visualization): NAN value is encountered when min and max are the…
Browse files Browse the repository at this point in the history
… same (#147)

* fixed dataVisualization from displaying black region when there is 1 value

* fix: rgbToHex is not defined

* fix: return the actual toColor hex

---------

Co-authored-by: alessandroboarotto <alessandro.boarotto@redder.it>
Co-authored-by: Mustafa Omar <themustafaomar@gmail.com>
  • Loading branch information
3 people authored May 5, 2024
1 parent ba86ed2 commit b3b8030
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/js/dataVisualization.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ class DataVisualization {
}

getValue(value) {
if (this.min === this.max) {
return `#${this._toColor.join('')}`
}

let hex, color = '#'

for (var i = 0; i < 3; i++) {
Expand Down

0 comments on commit b3b8030

Please sign in to comment.