Skip to content

Commit

Permalink
added change to update input boxes for gating slider after auto-gate
Browse files Browse the repository at this point in the history
  • Loading branch information
nchuynh committed Mar 1, 2022
1 parent 749508d commit fc25bdc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions minerva_analysis/client/src/js/views/csvGatingList.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class CSVGatingList {
autoBtn.classList.add('auto-btn');
autoBtn.setAttribute('id', "auto-btn_" + channelID);
autoBtn.textContent = "auto";
autoBtn.addEventListener("click", function() { self.autoGate(fullName) });
autoBtn.addEventListener("click", async function() { await self.autoGate(fullName) });

autoCol.appendChild(autoBtn);
autoBtn.addEventListener("click", e => e.stopPropagation());
Expand Down Expand Up @@ -303,13 +303,15 @@ class CSVGatingList {
* @function autoGate - applies thresholds based on Gaussian Mixture Model
* @param name - the name of the channel to apply it to
*/
autoGate(name) {
async autoGate(name) {
const self = this;
let shortName = self.dataLayer.getShortChannelName(name);

let gate = this.hasGatingGMM[shortName]['gate']
if (!this.dataLayer.isTransformed()) {
gate = parseInt(gate)
} else {
gate = gate.toFixed(7);
}
// For interaction
self.selections[name][0] = gate;
Expand Down Expand Up @@ -705,7 +707,7 @@ class CSVGatingList {
.attr('id', 'gating_slider-input' + channelID + i)
.attr('type', 'text')
.attr('class', 'input')
.attr('value', function(){return that.sliders.get(name).value()[i]});
.attr('value', function(){return csv_gatingList.sliders.get(name).value()[i]});
//remove the previous text label
d3.select(this).select('text').remove();
});
Expand Down

0 comments on commit fc25bdc

Please sign in to comment.