Skip to content

Commit

Permalink
Fix heatmap range slider bug [Closes #380] (#381)
Browse files Browse the repository at this point in the history
* Initialise bounding box at the beginning

* Fixed slider bug in heatmap

* Remove unnecessay console logs
  • Loading branch information
cjchirag7 authored Apr 17, 2020
1 parent d521a82 commit 717dbf5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion components/heatmapcontrol/heatmapcontrol.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ HeatmapControl.prototype.__refresh = function() {
this.elt.querySelector('.sel-field-panel select').addEventListener('change', this._selChanged.bind(this));
if (this.setting.mode=='binal') this.elt.querySelector('.sel-field-panel').style.display='none';


const fieldsPanel = this.elt.querySelector('.fields-panel');
this.setting.fields.forEach((f)=>{
this.rangeSliders[f.name] = createField(fieldsPanel, f, this.__change.bind(this));
Expand Down Expand Up @@ -215,6 +214,7 @@ HeatmapControl.prototype._selChanged = function(e) {
this.rangeSliders[f.name].disabled(true);
}
}, this);
this.resize.call(this);
this.__change.call(this);
};
HeatmapControl.prototype.resize = function() {
Expand Down Expand Up @@ -254,6 +254,7 @@ HeatmapControl.prototype.__change = function() {
data.field = field;
}
this.setting.onChange(data);
this.resize.call(this);
}
};

Expand Down
2 changes: 1 addition & 1 deletion core/extension/osd-heatmap-overlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@

// get the position of the current center points
this._center = this._viewer.viewport.getCenter(true);
this._getCanvasBoundBox = this.getCanvasBoundBox();
};

$.Heatmap.prototype = {
Expand Down Expand Up @@ -721,7 +722,6 @@
this._colors,
this._steps
);

const index =
this._fields.findIndex(
f => f.name === this._currentField.name,
Expand Down

0 comments on commit 717dbf5

Please sign in to comment.