Skip to content

Commit acd4d2b

Browse files
committed
Fix refresh for embedded csv
When we don't have files, refresh from the embedded CSV's
1 parent 03de18a commit acd4d2b

2 files changed

Lines changed: 20 additions & 4 deletions

File tree

generate_page_example.html

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -590,8 +590,16 @@
590590
function refresh() {
591591
d3.select('#dashboard').html("");
592592
d3.select('#focus').html("");
593-
for (i in gFiles) {
594-
processFile(gFiles[i]);
593+
if (gFiles.length > 0) {
594+
for (let i = 0; i < gFiles.length; ++i) {
595+
processFile(gFiles[i]);
596+
}
597+
} else {
598+
// If we don't have any files, refresh from the
599+
// embedded CSV's directly
600+
for (let i = 0; i < gCSVs.length; ++i) {
601+
processCSV(gCSVs[i], "csv " + i)
602+
}
595603
}
596604
}
597605

js/dashboard.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,8 +567,16 @@ function change_granularity(granularity, aggr_function) {
567567
function refresh() {
568568
d3.select('#dashboard').html("");
569569
d3.select('#focus').html("");
570-
for (i in gFiles) {
571-
processFile(gFiles[i]);
570+
if (gFiles.length > 0) {
571+
for (let i = 0; i < gFiles.length; ++i) {
572+
processFile(gFiles[i]);
573+
}
574+
} else {
575+
// If we don't have any files, refresh from the
576+
// embedded CSV's directly
577+
for (let i = 0; i < gCSVs.length; ++i) {
578+
processCSV(gCSVs[i], "csv " + i)
579+
}
572580
}
573581
}
574582

0 commit comments

Comments
 (0)