Skip to content

Commit

Permalink
Fix bug with molecules switching. Improve performance on mapping tab.
Browse files Browse the repository at this point in the history
  • Loading branch information
senkevich4000 committed Jan 22, 2021
1 parent abd98e5 commit 92b1465
Showing 1 changed file with 57 additions and 5 deletions.
62 changes: 57 additions & 5 deletions js/volume/core/SpotsController.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
'use strict';

define([
'spotscontrollerbase'
'spotscontrollerbase',
'utils',
],
function(SpotsControllerBase) {
function(SpotsControllerBase, Utils) {
function SpotsController() {
SpotsControllerBase.call(this, false);
this.spotBorder = 1.0;
Expand All @@ -15,9 +16,60 @@ function(SpotsControllerBase) {
SpotsController.Scale = SpotsControllerBase.Scale;

SpotsController.prototype = Object.create(SpotsControllerBase.prototype, {
_updateIntensities: {
value: function () {
this._notify(SpotsControllerBase.Events.ATTR_CHANGE);
minValue: {
get: function() {
return this._minValue;
},

set: function(value) {
if (this._autoMinMax) return;
this._minValue = Number(value);
this._notify(SpotsControllerBase.Events.MAPPING_CHANGE);
}
},

maxValue: {
get: function() {
return this._maxValue;
},

set: function(value) {
if (this._autoMinMax) return;
this._maxValue = Number(value);
this._notify(SpotsControllerBase.Events.MAPPING_CHANGE);
}
},

hotspotQuantile: {
get: function () {
return this._hotspotQuantile;
},

set: function (value) {
if (this._hotspotQuantile == value) {
return;
}
this._hotspotQuantile = Utils.boundNumber(0.0, value, 1.0);
if (this._autoMinMax) {
this._updateMinMaxValues();
} else {
console.log('Potential programming error: attempt to change "hotspot quantile" parameter with "auto min/max" disabled.');
}
this._notify(SpotsControllerBase.Events.AUTO_MAPPING_CHANGE);
}
},

autoMinMax: {
get: function() {
return this._autoMinMax;
},

set: function(value) {
this._autoMinMax = !!value;
if (this._autoMinMax) {
this._updateMinMaxValues();
}
this._notify(SpotsControllerBase.Events.AUTO_MAPPING_CHANGE);
}
},
});
Expand Down

0 comments on commit 92b1465

Please sign in to comment.