Getting rid of relative scale because it was not very interesting
This commit is contained in:
parent
f782040328
commit
46dcda4060
@ -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>
|
||||
|
@ -304,15 +304,14 @@
|
||||
//
|
||||
|
||||
grapher.Grapher = function(params) {
|
||||
var _canvas = params.canvas;
|
||||
var _columns = {};
|
||||
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 _displayType = params.displayType || 'density';
|
||||
var _onValueChanged = params.onValueChanged;
|
||||
var _canvas = params.canvas;
|
||||
var _columns = {};
|
||||
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 || false;
|
||||
var _displayType = params.displayType || 'density';
|
||||
var _onValueChanged = params.onValueChanged;
|
||||
|
||||
function processHintParameters(columns) {
|
||||
var displayTypes = {compatibility: 'compatibility', density: 'count'};
|
||||
@ -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;
|
||||
|
@ -81,13 +81,12 @@
|
||||
$.getJSON('/query', _ctx.query, function(results) {
|
||||
if (!_.has(_ctx, 'grapher')) {
|
||||
_ctx.grapher = new grapher.Grapher({
|
||||
canvas: new Snap('#svg'),
|
||||
steps: _ctx.query.hintSteps,
|
||||
range: _ctx.query.range,
|
||||
onValueChanged: onAdjust,
|
||||
displayType: $('#displayType').val(),
|
||||
useLocalScale: $('#useLocalScale').is(':checked'),
|
||||
useRelativeScale: $('#useRelativeScale').is(':checked')
|
||||
canvas: new Snap('#svg'),
|
||||
steps: _ctx.query.hintSteps,
|
||||
range: _ctx.query.range,
|
||||
onValueChanged: onAdjust,
|
||||
displayType: $('#displayType').val(),
|
||||
useLocalScale: $('#useLocalScale').is(':checked')
|
||||
});
|
||||
|
||||
$('#useLocalScale').click(function() {
|
||||
|
Loading…
Reference in New Issue
Block a user