1

More cleanup

This commit is contained in:
Alex Yatskov 2014-10-31 16:36:20 +09:00
parent b7eb24bae4
commit fa48d86c13
2 changed files with 10 additions and 14 deletions

View File

@ -74,11 +74,11 @@
canvas: new Snap('#svg'),
steps: ctx.hintSteps,
range: ctx.searchRange,
onValueChanged: onAdjust,
useLocalScale: true,
useRelativeScale: true
});
ctx.grapher.setColumns(results.columns);
ctx.grapher.setValueChangedListener(onAdjust);
saveSnapshot(results);
outputMatches(results.items, results.count);

View File

@ -291,6 +291,7 @@
var _steps = params.steps || 20;
var _useLocalScale = params.useLocalScale || true;
var _useRelativeScale = params.useRelativeScale || true;
var _onValueChanged = params.onValueChanged;
function computeLocalScale(hints) {
var counts = _.pluck(hints, 'count');
@ -333,13 +334,14 @@
}
else {
_columns[name] = new Column({
canvas: _canvas,
steps: _steps,
range: _range,
data: data,
name: name,
scale: scale,
index: index++,
onValueChanged: _onValueChanged,
steps: _steps,
range: _range,
canvas: _canvas,
data: data,
name: name,
scale: scale,
index: index++,
});
}
}
@ -358,11 +360,5 @@
this.setColumns(_data);
}
};
this.setValueChangedListener = function(listener) {
for (var name in _columns) {
_columns[name].onValueChanged = listener;
}
};
};
}(window.grapher = window.grapher || {}));