Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export Dataset object #1478

Merged
merged 1 commit into from
Mar 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions src/actions/loadData.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ function fetchAndParseNarrative(url) {
});
}


function addEndOfNarrativeBlock(narrativeBlocks) {
/* this function is exported as auspice.us uses it */
export function addEndOfNarrativeBlock(narrativeBlocks) {
const lastContentSlide = narrativeBlocks[narrativeBlocks.length-1];
const endOfNarrativeSlide = Object.assign({}, lastContentSlide, {
__html: undefined,
Expand Down Expand Up @@ -257,8 +257,9 @@ function parseNarrativeDatasets(blocks, query) {
* The Dataset object holds information about a single dataset (e.g. "zika") and
* corresponding sidecar files. It contains prototypes to help with fetching and loading
* of these data.
* This function is exported as auspice.us uses it.
*/
function Dataset(name) {
export function Dataset(name) {
this.name = name;
this.pathname = undefined; // the dataset name to show. May be different from the name.
this.apiCalls = {};
Expand Down Expand Up @@ -311,10 +312,12 @@ Dataset.prototype.loadSidecars = function loadSidecars(dispatch) {
dispatch(warningNotification({message: "Failed to fetch frequencies"}));
});
}
this.rootSequence.then((data) => {
dispatch({type: types.SET_ROOT_SEQUENCE, data});
dispatch(updateColorByWithRootSequenceData());
});
if (this.rootSequence) {
this.rootSequence.then((data) => {
dispatch({type: types.SET_ROOT_SEQUENCE, data});
dispatch(updateColorByWithRootSequenceData());
});
}
if (this.measurements) {
this.measurements
.then((data) => dispatch(loadMeasurements(data)))
Expand Down