diff --git a/scripts/get-data.sh b/scripts/get-data.sh index ac31532ef..dd3292ca0 100755 --- a/scripts/get-data.sh +++ b/scripts/get-data.sh @@ -1,7 +1,6 @@ #!/bin/bash data_files=( "manifest_guest.json" \ - "img_mumps.png" "img_dengue.png" "img_avianinfluenza.png" "img_seasonalinfluenza.png" "img_ebola.png" "img_zika.png" "img_measles.png" "img_lassa.jpg" "img_wnv.png"\ "dengue_all_tree.json" "dengue_all_meta.json" \ "dengue_denv1_tree.json" "dengue_denv1_meta.json" \ "dengue_denv2_tree.json" "dengue_denv2_meta.json" \ @@ -58,6 +57,8 @@ data_files=( "flu_seasonal_yam_na_3y_tree.json" "flu_seasonal_yam_na_3y_meta.json" "flu_seasonal_yam_na_3y_tip-frequencies.json" \ "flu_seasonal_yam_na_6y_tree.json" "flu_seasonal_yam_na_6y_meta.json" "flu_seasonal_yam_na_6y_tip-frequencies.json" \ "flu_seasonal_yam_na_12y_tree.json" "flu_seasonal_yam_na_12y_meta.json" "flu_seasonal_yam_na_12y_tip-frequencies.json" \ + "enterovirus_d68_genome_meta.json" "enterovirus_d68_genome_tree.json" \ + "enterovirus_d68_vp1_meta.json" "enterovirus_d68_vp1_tree.json" \ ) rm -rf data/ diff --git a/src/actions/recomputeReduxState.js b/src/actions/recomputeReduxState.js index d6af89acb..092b52214 100644 --- a/src/actions/recomputeReduxState.js +++ b/src/actions/recomputeReduxState.js @@ -548,7 +548,7 @@ export const createStateFromQueryOrJSONs = ({ if (query.clade) { tree = modifyTreeStateVisAndBranchThickness(tree, undefined, query.clade, controls); } else { /* if not specifically given in URL, zoom to root */ - tree = modifyTreeStateVisAndBranchThickness(tree, undefined, 'root', controls); + tree = modifyTreeStateVisAndBranchThickness(tree, undefined, undefined, controls); } tree = modifyTreeStateVisAndBranchThickness(tree, query.s, undefined, controls); if (treeToo && treeToo.loaded) { diff --git a/src/actions/tree.js b/src/actions/tree.js index e4243ed4a..eb0de87c2 100644 --- a/src/actions/tree.js +++ b/src/actions/tree.js @@ -68,15 +68,20 @@ const processSelectedTip = (d, tree, treeToo) => { * for arg destructuring see https://simonsmith.io/destructuring-objects-as-function-parameters-in-es6/ * @param {array|undefined} root Change the in-view part of the tree. [root idx tree1, root idx tree2]. * [0, 0]: reset. [undefined, undefined]: do nothing - * @param {object} tipSelected - * @param {int} idxOfInViewRootNodeTreeToo - * @return {null} side effects: a single action + * @param {object | undefined} tipSelected + * @param {string | undefined} cladeSelected + * @return {function} a function to be handled by redux (thunk) */ export const updateVisibleTipsAndBranchThicknesses = ( {root = [undefined, undefined], tipSelected = undefined, cladeSelected = undefined} = {} ) => { return (dispatch, getState) => { const { tree, treeToo, controls, frequencies } = getState(); + if (root[0] === undefined && !cladeSelected && tree.selectedClade) { + /* if not resetting tree to root, maintain previous selectedClade if one exists */ + cladeSelected = tree.selectedClade; + } + if (!tree.nodes) {return;} // console.log("ROOT SETTING TO", root) /* mark nodes as "in view" as applicable */