Fixing bug in computing result density.
This commit is contained in:
parent
54a912cac3
commit
8e30a32b1c
@ -95,7 +95,6 @@
|
||||
var _onValueChanged = params.onValueChanged;
|
||||
var _range = params.range;
|
||||
var _scale = params.scale;
|
||||
var _steps = params.steps;
|
||||
var _elements = {};
|
||||
|
||||
function createShapes() {
|
||||
@ -194,10 +193,12 @@
|
||||
}
|
||||
|
||||
function groupHints() {
|
||||
var stepSize = _range.length() / _steps;
|
||||
|
||||
var hintGroups = [];
|
||||
for (var i = 0; i < _steps; ++i) {
|
||||
|
||||
var stepCount = _data.hints.length;
|
||||
if (stepCount > 0) {
|
||||
var stepSize = _range.length() / stepCount;
|
||||
for (var i = 0; i < stepCount; ++i) {
|
||||
var stepMax = _range.max - stepSize * i;
|
||||
var stepMin = stepMax - stepSize;
|
||||
|
||||
@ -211,6 +212,7 @@
|
||||
|
||||
hintGroups.push(hintValue);
|
||||
}
|
||||
}
|
||||
|
||||
return hintGroups;
|
||||
}
|
||||
@ -308,7 +310,6 @@
|
||||
var _columns = {};
|
||||
var _data = {};
|
||||
var _range = new Range(-1.0, 1.0);
|
||||
var _steps = params.steps || 20;
|
||||
var _useLocalScale = params.useLocalScale || false;
|
||||
var _displayType = params.displayType || 'density';
|
||||
var _onValueChanged = params.onValueChanged;
|
||||
@ -370,7 +371,6 @@
|
||||
else {
|
||||
_columns[name] = new Column({
|
||||
onValueChanged: _onValueChanged,
|
||||
steps: _steps,
|
||||
range: _range,
|
||||
canvas: _canvas,
|
||||
data: columnData,
|
||||
|
@ -97,7 +97,6 @@
|
||||
if (!_.has(_ctx, 'grapher')) {
|
||||
_ctx.grapher = new grapher.Grapher({
|
||||
canvas: new Snap('#svg'),
|
||||
steps: _ctx.query.hintSteps,
|
||||
onValueChanged: onAdjust,
|
||||
displayType: $('#displayType').val(),
|
||||
useLocalScale: $('#useLocalScale').is(':checked')
|
||||
|
Loading…
Reference in New Issue
Block a user