mirror of
https://github.com/nasa/openmct.git
synced 2025-02-06 19:19:23 +00:00
[Style] Pull functions out of loop
Pull functions out of loop for jshint compliance.
This commit is contained in:
parent
b9e0a77655
commit
668b09b789
@ -57,14 +57,23 @@ define([], function () {
|
|||||||
rows = [],
|
rows = [],
|
||||||
row,
|
row,
|
||||||
i;
|
i;
|
||||||
|
|
||||||
|
function copyDomainsToRow(row, index) {
|
||||||
|
domains.forEach(function (domain) {
|
||||||
|
row[domain.name] = series.getDomainValue(index, domain.key);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function copyRangesToRow(row, index) {
|
||||||
|
ranges.forEach(function (range) {
|
||||||
|
row[range.name] = series.getRangeValue(index, range.key);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < series.getPointCount(); i += 1) {
|
for (i = 0; i < series.getPointCount(); i += 1) {
|
||||||
row = {};
|
row = {};
|
||||||
domains.forEach(function (domain) {
|
copyDomainsToRow(row, i);
|
||||||
row[domain.name] = series.getDomainValue(i, domain.key);
|
copyRangesToRow(row, i);
|
||||||
});
|
|
||||||
ranges.forEach(function (range) {
|
|
||||||
row[range.name] = series.getRangeValue(i, range.key);
|
|
||||||
});
|
|
||||||
rows.push(row);
|
rows.push(row);
|
||||||
}
|
}
|
||||||
exportService.exportCSV(rows, { headers: headers });
|
exportService.exportCSV(rows, { headers: headers });
|
||||||
|
Loading…
x
Reference in New Issue
Block a user