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'), canvas: new Snap('#svg'),
steps: ctx.hintSteps, steps: ctx.hintSteps,
range: ctx.searchRange, range: ctx.searchRange,
onValueChanged: onAdjust,
useLocalScale: true, useLocalScale: true,
useRelativeScale: true useRelativeScale: true
}); });
ctx.grapher.setColumns(results.columns); ctx.grapher.setColumns(results.columns);
ctx.grapher.setValueChangedListener(onAdjust);
saveSnapshot(results); saveSnapshot(results);
outputMatches(results.items, results.count); outputMatches(results.items, results.count);

View File

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