-
Notifications
You must be signed in to change notification settings - Fork 166
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
Show transmission lines toggle should only appear if transmission lines can be drawn #1154
Comments
@jameshadfield I would like to work on this. |
I would also like to work on this if it is not already resolved. I was looking to implement this as part of a school project @jameshadfield. @TAM360 have you already implemented your changes? |
@sinloes you can work on this issue. |
@sinloes and I are working on this issue together. We are thinking of doing something similar to what setupTransmissionData does in mapHelpersatLong.js and cause showTransmissionsToggle to change as a result of change in georesolution. We are thinking of making the change in modifyControlsStateViaTree within recomputeReduxState.js but we're confused about what the tree in this function is referring to. Any thoughts? |
Hi @danherre @sinloes -- I hope you were able to make some progress without me. Am I right in thinking your plan is to set this redux state such as
The following sketch may help understand the data transforms present when you load a dataset: So the P.S. I know |
Background
#1147 introduced a toggle to control whether we show transmissions on the map. This toggle is always present, regardless of whether the data is actually present in the tree. If transmissions are not defined by the tree, then the toggle has no real effect.
The presence of transmission lines are completely dependent on the geo-resolution. For a geo-resolution of “X” (e.g. X=division) to be drawn you need the internal nodes of the tree to have values for X assigned to them.
If a selected color-by Y (e.g. Y=clades) has also been inferred for internal nodes, then you get coloured transmission lines. Otherwise they’re grey.
This issue
The toggle shouldn't appear for geographic resolutions which don't have transmissions available.
Implementation details
We don't have an easy check for this at the moment. The only current way we know about this is within the
<Map>
component where we runsetupTransmissionData
which creates thetransmissionData
array. Note that this code is not run if the toggle (showTransmissionLines
) isfalse
.One solution could be to define a piece of redux state (e.g.
reduxState.controls.geoResDefinesTransmissions
) which is recalculated when the geo-res changes. The value is determined by a return-early traversal of the tree looking for a non-terminal node with a value set for that geo-res.Test data set
https://nextstrain.org/mumps/global (available for a local auspice build via
npm run get-data
). The geo-res "country" does not contain the information needed for transmission lines and therefore should not get the toggle. The geo res "region" does.The text was updated successfully, but these errors were encountered: