Skip to content

Commit

Permalink
Merge pull request #372 from girder/deepssm-color-scale-fix
Browse files Browse the repository at this point in the history
Color scale bar error handling for missing deepssm_error
  • Loading branch information
JakeWags authored Apr 16, 2024
2 parents 173c7b5 + 3749d04 commit c69bc2f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion web/shapeworks/src/components/ShapeViewer/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,10 @@ export default {
this.prepareColorScale(canvas, labels, range)
} else {
Object.entries(this.data).forEach(([, data], i) => {
// if the shape (vtk only) doesn't have the deepssm_error array, don't show the color scale
if (data[0].shape.filter((shape) => shape.getClassName() === 'vtkPolyData' && !shape.getPointData().getArrayByName('deepssm_error')).length > 0) {
return;
}
const [, y1, x2, y2] = this.grid[i]
const canvas = document.createElement('canvas')
canvas.style.top = `calc(${(1 - y2) * 100}%)`
Expand All @@ -434,7 +438,7 @@ export default {
if (shape.getClassName() === 'vtkPolyData') {
const arr = shape.getPointData().getArrayByName('deepssm_error').getData()
if (arr) range = [Math.min(...arr), Math.max(...arr)]
}
}
})
this.prepareColorScale(canvas, labels, range)
})
Expand Down

0 comments on commit c69bc2f

Please sign in to comment.