Skip to content

Commit

Permalink
Fix refresh for embedded csv
Browse files Browse the repository at this point in the history
When we don't have files, refresh from the embedded CSV's
  • Loading branch information
ianw committed Oct 22, 2021
1 parent f3545ad commit 8e2003e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
12 changes: 10 additions & 2 deletions generate_page_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -590,8 +590,16 @@
function refresh() {
d3.select('#dashboard').html("");
d3.select('#focus').html("");
for (i in gFiles) {
processFile(gFiles[i]);
if (gFiles.length > 0) {
for (let i = 0; i < gFiles.length; ++i) {
processFile(gFiles[i]);
}
} else {
// If we don't have any files, refresh from the
// embedded CSV's directly
for (let i = 0; i < gCSVs.length; ++i) {
processCSV(gCSVs[i], "csv " + i)
}
}
}

Expand Down
12 changes: 10 additions & 2 deletions js/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,16 @@ function change_granularity(granularity, aggr_function) {
function refresh() {
d3.select('#dashboard').html("");
d3.select('#focus').html("");
for (i in gFiles) {
processFile(gFiles[i]);
if (gFiles.length > 0) {
for (let i = 0; i < gFiles.length; ++i) {
processFile(gFiles[i]);
}
} else {
// If we don't have any files, refresh from the
// embedded CSV's directly
for (let i = 0; i < gCSVs.length; ++i) {
processCSV(gCSVs[i], "csv " + i)
}
}
}

Expand Down

0 comments on commit 8e2003e

Please sign in to comment.