1

Getting rid of relative scale because it was not very interesting

This commit is contained in:
Alex Yatskov 2015-03-22 12:10:53 +09:00
parent f782040328
commit 46dcda4060
3 changed files with 17 additions and 34 deletions

View File

@ -65,10 +65,7 @@
</select>
</div>
<div class="checkbox">
<label><input type="checkbox" id="useLocalScale" checked="checked">Use local scale</label>
</div>
<div class="checkbox">
<label><input type="checkbox" id="useRelativeScale" checked="checked">Use relative scale</label>
<label><input type="checkbox" id="useLocalScale">Use local scale</label>
</div>
<button type="button" data-toggle="modal" data-target="#profileDlg" class="btn btn-primary">Edit personal profile</button>
</div>

View File

@ -309,8 +309,7 @@
var _data = {};
var _range = new Range(params.range.min || -1.0, params.range.max || 1.0);
var _steps = params.steps || 20;
var _useLocalScale = params.useLocalScale || true;
var _useRelativeScale = params.useRelativeScale || true;
var _useLocalScale = params.useLocalScale || false;
var _displayType = params.displayType || 'density';
var _onValueChanged = params.onValueChanged;
@ -331,12 +330,7 @@
return hint.rating;
});
var min = 0;
if (_useRelativeScale) {
min = _.min(ratings);
}
return new Range(min, _.max(ratings));
return new Range(0, _.max(ratings));
}
function computeGlobalScale(columnsData) {
@ -357,7 +351,7 @@
this.setColumns = function(columnsData) {
processHintParameters(columnsData);
var scale = 0;
var scale = null;
if (!_useLocalScale) {
scale = computeGlobalScale(columnsData);
}
@ -395,13 +389,6 @@
}
};
this.setUseRelativeScale = function(useRelativeScale) {
if (useRelativeScale != _useRelativeScale) {
_useRelativeScale = useRelativeScale;
this.setColumns(_data);
}
};
this.setDisplayType = function(displayType) {
if (displayType != _displayType) {
_displayType = displayType;

View File

@ -86,8 +86,7 @@
range: _ctx.query.range,
onValueChanged: onAdjust,
displayType: $('#displayType').val(),
useLocalScale: $('#useLocalScale').is(':checked'),
useRelativeScale: $('#useRelativeScale').is(':checked')
useLocalScale: $('#useLocalScale').is(':checked')
});
$('#useLocalScale').click(function() {