-
Notifications
You must be signed in to change notification settings - Fork 163
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
Narratives bug #736
Narratives bug #736
Commits on Jul 9, 2019
-
Map helpers: refactor updateOnMoveEnd
Because the `updateOnMoveEnd` function only runs code inside the conditional `if (d3elems) {}`, refactor to create a `if (!d3elems) {}` guard statements and unindent the code within the function.
Configuration menu - View commit details
-
Copy full SHA for eeebdb6 - Browse repository at this point
Copy the full SHA eeebdb6View commit details -
In `maybeUpdateDemesAndTransmissions()`, the variable `haveData` was not always a boolean as was seemingly intended by its naming and usage. Change one of the values in its declaration to evaluate to a boolean by prefixing `!!`. Now `!!nextProps.nodeColors` evaluates to `true` or `false` instead of a list or `false`.
Configuration menu - View commit details
-
Copy full SHA for 26b26fc - Browse repository at this point
Copy the full SHA 26b26fcView commit details -
Map: refactor maybeUpdateDemesAndTransmissions
Previously, in the function `maybeUpdateDemesAndTransmissions()` (part of the Map component), there was a large, indented code block inside of a conditional checking for truthiness in `colorOrVisibilityChange && haveData`. Because changes only occurred if this conditional was true, refactor it so that the conditional is now a guard statement. If the conditional evaluates to false, exit the function. Now the bulk of the code is not indented.
Configuration menu - View commit details
-
Copy full SHA for 8aa787d - Browse repository at this point
Copy the full SHA 8aa787dView commit details -
Map helpers: refactor setupTransmissionData
Reduce the level of indendation of the bulk of the code in the function `setupTransmissionData` by refactoring two of the conditional checks into guard statements. This change reduces the cognitive load required to read and understand this function.
Configuration menu - View commit details
-
Copy full SHA for 607c977 - Browse repository at this point
Copy the full SHA 607c977View commit details -
Map helpers: refactor setupDemeData
Refactor the function `setupDemeData` for better readability by reducing the level of indentation of the code. This commit converts two conditional checks into guard statements that exit the `forEach` loop if each condition is not met. Also removes an explicit `boolean === true` check in favor of `boolean`.
Configuration menu - View commit details
-
Copy full SHA for b8614a5 - Browse repository at this point
Copy the full SHA b8614a5View commit details -
Map: refactor maybeDrawDemesAndTransmissions
Shorten a conditional by casting the string to lower case.
Configuration menu - View commit details
-
Copy full SHA for 1f808b4 - Browse repository at this point
Copy the full SHA 1f808b4View commit details -
Map helpers: refactor updateTransmissionDataCol...
Refactor the `updateTransmissionDataColAndVis` function to reduce the level of indendation of the code. Convert the conditional checks to guard statements that exist the `forEach` loop if the condition is not met.
Configuration menu - View commit details
-
Copy full SHA for 714b487 - Browse repository at this point
Copy the full SHA 714b487View commit details -
Map helpers: log updateVisibility error
Logs an error in the function `updateVisibility' if `d3elems` is undefined. Co-authored-by: James Hadfield <jhadfiel@fredhutch.org>
Configuration menu - View commit details
-
Copy full SHA for a307d1c - Browse repository at this point
Copy the full SHA a307d1cView commit details -
Map: fix bug re: geo resolution changes. Closes #722
Previously, when the geo resolution would change, `drawDemesAndTransmissions` would not necessarily be called, often causing data on the map to not load at all between queries. James also did some work here to correct the deme and transmission data that were being loaded on each narrative page change. This commit further complicates the map code, but is necessary to fix this bug. It is a prime candidate for refactoring in #735 Co-authored-by: James Hadfield <jh22@sanger.ac.uk> Co-authored-by: Jover Lee <joverlee521@gmail.com>
Configuration menu - View commit details
-
Copy full SHA for 30299e5 - Browse repository at this point
Copy the full SHA 30299e5View commit details