Skip to content

Commit

Permalink
Add confidence intervals to URL state nextstrain#522
Browse files Browse the repository at this point in the history
  • Loading branch information
eharkins committed Apr 6, 2020
1 parent 2f74df0 commit 9331342
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/actions/recomputeReduxState.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ const modifyStateViaURLQuery = (state, query) => {
if (query.c) {
state["colorBy"] = query.c;
}
if (query.ci) {
state["temporalConfidence"]["on"] = true;
}
if (query.r) {
state["geoResolution"] = query.r;
}
Expand Down
7 changes: 7 additions & 0 deletions src/middleware/changeURL.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ export const changeURLMiddleware = (store) => (next) => (action) => {
case types.NEW_COLORS:
query.c = action.colorBy === state.controls.defaults.colorBy ? undefined : action.colorBy;
break;
case types.TOGGLE_TEMPORAL_CONF:
if ("ci" in query) {
query.ci = undefined;
} else {
query.ci = true;
}
break;
case types.APPLY_FILTER: {
query[`f_${action.trait}`] = action.values.join(',');
break;
Expand Down

0 comments on commit 9331342

Please sign in to comment.