Skip to content

Commit

Permalink
Slightly better progress meter on cross-sectional view
Browse files Browse the repository at this point in the history
  • Loading branch information
driusan committed Oct 2, 2023
1 parent f9e9b63 commit db3aa4b
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions modules/dataquery/jsx/viewdata.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ function organizeData(
for (const candidaterow of resultData) {
promises.push(new Promise<TableRow[]>((resolve) => {
// Collect list of visits for this candidate
setTimeout( () => {
const candidatevisits: {[visit: string]: boolean} = {};
for (const i in candidaterow) {
if (!candidaterow.hasOwnProperty(i)) {
Expand Down Expand Up @@ -475,6 +476,7 @@ function organizeData(
}
onProgress(rowNum++);
resolve(dataRows);
});
}));
}

Expand Down Expand Up @@ -866,12 +868,14 @@ function organizeHeaders(
return Promise.resolve(headers);
case 'crosssection':
return new Promise( (resolve) => {
resolve(['Visit Label',
...fields.map((val, i) => {
onProgress(i);
return formatHeader(val);
}),
]);
setTimeout( () => {
resolve(['Visit Label',
...fields.map((val, i) => {
onProgress(i);
return formatHeader(val);
}),
]);
});
});
default: throw new Error('Unhandled visit organization');
}
Expand Down

0 comments on commit db3aa4b

Please sign in to comment.