Skip to content

Commit

Permalink
dashboard: moving prepareData function into utils
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelfsilva committed Jul 10, 2020
1 parent a6830a8 commit 6beaa98
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
18 changes: 0 additions & 18 deletions tools/wrench/dashboard/scripts/initialize.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,3 @@
function prepareData(data) {
const nullReplacement = {
start: 0,
end: 0
};
data.forEach(function (d) {
if (d.read === null) {
d.read = [nullReplacement];
}
if (d.compute === null) {
d.compute = nullReplacement;
}
if (d.write === null) {
d.write = [nullReplacement];
}
})
return data;
}

function initialize() {
const noFileDiv = document.getElementById("no-file");
Expand Down
18 changes: 18 additions & 0 deletions tools/wrench/dashboard/scripts/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,24 @@ function processFile(files) {
});
}

function prepareData(data) {
const nullReplacement = {
start: 0,
end: 0
};
data.forEach(function (d) {
if (d.read === null) {
d.read = [nullReplacement];
}
if (d.compute === null) {
d.compute = nullReplacement;
}
if (d.write === null) {
d.write = [nullReplacement];
}
})
return data;
}

const getDuration = (d, section) => {
if (section === "read" || section === "write") {
Expand Down

0 comments on commit 6beaa98

Please sign in to comment.