Skip to content

Commit

Permalink
LIMS-140: Clear up inverting of data
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Williams committed Sep 27, 2023
1 parent 5f0c5a7 commit dcd88dd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions client/src/js/modules/dc/views/gridplot.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,10 @@ define(['jquery', 'marionette',
if (d.length > 0) {
let max = 0
let power = this.invertHeatMap ? -1 : 1
let val = 0
_.each(d, function(v) {
if (Math.pow(v[1],power) > max) max = Math.pow(v[1],power)
val = Math.pow(v[1], power)
if (val > max) max = val
})

max = max === 0 ? 1 : max
Expand All @@ -431,6 +433,7 @@ define(['jquery', 'marionette',
var data = []
_.each(d, function(v) {
var k = v[0] - 1
val = Math.pow(v[1], power)

// Account for vertical grid scans
let xstep, ystep, x, y
Expand Down Expand Up @@ -461,7 +464,7 @@ define(['jquery', 'marionette',
data.push({
x: x,
y: y,
value: v[1] < 1 && max > 1 ? 0 : Math.pow(v[1], power),
value: val < 1 && max > 1 ? 0 : val,
radius: radius
})

Expand Down

0 comments on commit dcd88dd

Please sign in to comment.