Skip to content

Commit

Permalink
LIMS-1126: Improve display of pia_estimated_d_min
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Williams committed Nov 23, 2023
1 parent ff3e520 commit 835e236
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions client/src/js/modules/dc/views/gridplot.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,10 @@ define(['jquery', 'marionette',
if (this.hasSnapshot && utils.inView(this.$el)) this.draw()
},

displayResolution: function(val) {
if (val < 0) { return 0 }
return 100 * Math.pow(val, -1)
},

draw: function() {
if (!this.ctx || !this.gridFetched) return
Expand Down Expand Up @@ -414,15 +418,17 @@ define(['jquery', 'marionette',

if (d.length > 0) {
let max = 0
let power = this.invertHeatMap ? -1 : 1
let val = 0

_.each(d, function(v) {
val = Math.pow(v[1], power)
if (val > max) max = val
if (v[1] > max) max = v[1]
})

max = max === 0 ? 1 : max
if (this.getOption('padMax') && max < 10 && !this.invertHeatMap) max = max * 50
if (this.getOption('padMax') && max < 10) max = max * 50

// 1.4Å
if (this.invertHeatMap) max = 100 / 1.4

var sw = (this.perceivedw-(this.offset_w*this.scale))/this.grid.get('STEPS_X')
var sh = (this.perceivedh-(this.offset_h*this.scale))/this.grid.get('STEPS_Y')
Expand All @@ -433,7 +439,7 @@ define(['jquery', 'marionette',
var data = []
_.each(d, function(v) {
var k = v[0] - 1
val = Math.pow(v[1], power)
val = this.invertHeatMap ? this.displayResolution(v[1]) : v[1]

// Account for vertical grid scans
let xstep, ystep, x, y
Expand Down

0 comments on commit 835e236

Please sign in to comment.