[Plot] Fill in specs

Fill in specs for elements used by the PlotController
in order to improve coverage of the plot bundle.
WTD-533.
This commit is contained in:
Victor Woeltjen
2014-12-02 10:11:46 -08:00
parent ae05ed903b
commit 2f475fc17a
8 changed files with 348 additions and 25 deletions

View File

@ -17,23 +17,18 @@ define(
min = [Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY],
x,
y,
xLabels = {},
yLabels = {},
yUnits = {},
domainOffset = Number.POSITIVE_INFINITY,
buffers;
datas = datas || [];
// Remove any undefined data sets
datas = (datas || []).filter(identity);
datas.filter(identity).forEach(function (data) {
// Filter out un
datas.forEach(function (data) {
domainOffset = Math.min(data.getDomainValue(0, domain), domainOffset);
});
datas.forEach(function (data, i) {
if (!data) {
return; // skip null data
}
vertices.push([]);
for (index = 0; index < data.getPointCount(); index = index + 1) {
x = data.getDomainValue(index, domain);
@ -45,18 +40,6 @@ define(
max[0] = Math.max(max[0], x);
max[1] = Math.max(max[1], y);
}
if (data.getDomainLabel) {
xLabels[data.getDomainLabel(domain)] = true;
}
if (data.getRangeLabel) {
yLabels[data.getRangeLabel(range)] = true;
}
if (data.getRangeUnits) {
yUnits[data.getRangeUnits(range)] = true;
}
});
if (max[1] === min[1]) {
@ -64,10 +47,6 @@ define(
min[1] = min[1] - 1.0;
}
xLabels = Object.keys(xLabels).sort();
yLabels = Object.keys(yLabels).sort();
yUnits = Object.keys(yUnits).sort();
buffers = vertices.map(function (v) { return new Float32Array(v); });
return {