-
Notifications
You must be signed in to change notification settings - Fork 60
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
feat(web): sort & run #1562
Draft
ivan-aksamentov
wants to merge
17
commits into
master
Choose a base branch
from
feat/web-sort-and-run
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
feat(web): sort & run #1562
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This should allow us to identify outputs once we receive them
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This modifies many state atoms into atom families parameterized by the currently viewed datasets. This prepares the app to allow to run analysis on multiple datasets at the same time and to switch between multiple datasets when browsing the results of such run.
This triggered a webpack warning and was caused by the import of `findDatasetNameBySeqNameStrings` from a module from main bunle into the webworker file.
I initialize the datasets atom (containing all fetched datasets once they are fetched) initially to an empty array to avoid triggering infinite `<Suspense/>`
We may or may not change this list later, but for now lets assume all suggested datasets need to be initialized and be able to run
Unrelated change, but it's a quick improvement. Even though types are duplicated, TypeScript allows this as long as the types are structurally the same, which was easy to adjust. This way we don't need a cast.
Here I split the analysis results before passing them to the tree placement. Because analyses are specific to a dataset they were analyzed with, they are only compatible with the tree coming from the same dataset.
Th map needed a copy. Let's also improve checking of the nil values as well as make key names consistent with the corresponding storage atom.
This required a little bit more processing of suggestion results. We need different maps : from sequence index to dataset name (smaller; to pass to webworkers), from sequence index to full dataset object (larger; to use locally), and vice versa. The `processSuggestionResults()` has grown a bit too big and might need to be refactored and split into smaller functions (or react hooks or recoil selectors)
Auspice state is global and is stored in Redux. From Nextclade we don't have access to how state is stored and operated on. But we need to switch what Auspice is rendeing when viewed dataset is changed. Instead of recomputing the state on every switch, I decided to try and precompute what's the necessary state in the webworker, as before but for each of the multiple datasets now. Then I dump the entire auspice state in recoil atom family (by dataset name). When a dataset is selected on tree page, I can now quickly restore the redux state from saved state. This way we can hopefully quickly switch what Auspice is rendering.
This is dangerous because the state for one dataset may be invalid for another dataset. Here I create a memoized Map of auspice tree components by dataset name - this way the auspice component instances are different components.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.