1

Fixing ambiguous naming

This commit is contained in:
Alex Yatskov 2015-03-21 20:52:47 +09:00
parent cab7eb21bb
commit 8bc31046c7

View File

@ -326,8 +326,8 @@
} }
} }
function computeLocalScale(column) { function computeLocalScale(columnData) {
var ratings = _.map(column.hints, function(hint) { var ratings = _.map(columnData.hints, function(hint) {
return hint.rating; return hint.rating;
}); });
@ -339,10 +339,10 @@
return new Range(min, _.max(ratings)); return new Range(min, _.max(ratings));
} }
function computeGlobalScale(columns) { function computeGlobalScale(columnsData) {
var globalScale = null; var globalScale = null;
for (var i = 0, count = columns.length; i < count; ++i) { for (var i = 0, count = columnsData.length; i < count; ++i) {
var localScale = computeLocalScale(columns[i]); var localScale = computeLocalScale(columnsData[i]);
if (globalScale) { if (globalScale) {
globalScale.include(localScale); globalScale.include(localScale);
} }
@ -354,24 +354,24 @@
return globalScale; return globalScale;
} }
this.setColumns = function(columns) { this.setColumns = function(columnsData) {
processHintParameters(columns); processHintParameters(columnsData);
var scale = 0; var scale = 0;
if (!_useLocalScale) { if (!_useLocalScale) {
scale = computeGlobalScale(columns); scale = computeGlobalScale(columnsData);
} }
var index = 0; var index = 0;
for (var name in columns) { for (var name in columnsData) {
var data = _data[name] = columns[name]; var columnData = _data[name] = columnsData[name];
if (_useLocalScale) { if (_useLocalScale) {
scale = computeLocalScale(data); scale = computeLocalScale(columnData);
} }
var column = _columns[name]; var column = _columns[name];
if (column) { if (column) {
column.update(data, scale); column.update(columnData, scale);
} }
else { else {
_columns[name] = new Column({ _columns[name] = new Column({
@ -379,7 +379,7 @@
steps: _steps, steps: _steps,
range: _range, range: _range,
canvas: _canvas, canvas: _canvas,
data: data, data: columnData,
name: name, name: name,
scale: scale, scale: scale,
index: index++, index: index++,