-
Notifications
You must be signed in to change notification settings - Fork 8
feat: homepage sunburst display of available data (#289) #396
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
Conversation
951ba28
to
93c5e77
Compare
8e8ac9a
to
f4caefc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am told that this is about ready for review, so here are some potential issues I notice currently:
- The mapping from rank to filter key still includes
superkingdom
, which should be replaced withdomain
andrealm
. strain
is also absent from the mapping, despite appearing in the tree.- It seems odd to me that the filter defaults to genus when the rank isn't in the mapping -- I would expect
createFilterUrl
to returnnull
in that case maybe? - The leaf node counts that are labeled as "assemblies" in the interface don't really correspond to anything in the data browser (meaning the result count doesn't match when you open the link to the filtered assemblies) -- the assembly list in the data browser has multiple assemblies for some taxa, and the organisms list wouldn't fit either because it's a list of species (as opposed to potentially being more granular with strain/etc like the tree is).
- I'm not sure what the best immediate solution would be, but something I've talked about with @NoopDog that I'm not sure ever got brought up elsewhere is that we could build the taxa tree from the taxonomic data that we were already using in the assembly list; if we did that it would likely be straightforward to count the assemblies as the tree is built.
Regarding the type errors in sunburst.tsx
, I think there are three broad categories of errors that I see (although note that my impressions are based in large part on the type definitions for d3 so it's possible I'm missing some subtleties):
- Lack of type annotations, both for parameters in function definitions and as type parameters to function calls; e.g.:
- On line 42,
getNodeColor
lacks type annotations for its parameters, which causes them to default toany
and is disallowed by our configuration; the d3 types suggest that the parameters should be typed asd: d3.HierarchyRectangularNode<SourceTreeNode>, root: d3.HierarchyRectangularNode<SourceTreeNode>
, if theTreeNode
type fromdata.ts
was imported asSourceTreeNode
. - On line 107,
d3.partition()
takes a type parameter that defaults tounknown
, which causes a mismatch whenhierarchyData
is passed in later. The d3 types suggest that that initial function call should bed3.partition<SourceTreeNode>()
.
- On line 42,
- Inaccurate type annotations? It seems to me like there might be some confusion between the
TreeNode
type fromdata.ts
, theTreeNode
type fromNodeDetails.tsx
, and the d3 node types -- though looking more closely maybeTreeNode
from NodeDetails is intentionally used for d3 nodes? (In which case I might expect it to be defined by extending a d3 type if possible.) - The addition of properties such as
current
to d3 nodes (assuming I'm understanding correctly and that's what's going on?) -- I think it would work better with TypeScript if that data could be stored outside the d3 node (such as via a map and/or the data associated with the node), but if that's not feasible a solution might be to define something likegetCurrent
andsetCurrent
functions that use type assertions to allow thecurrent
property to be referenced. Or, if theTreeNode
type represents the addition of these properties, maybe just inlineas TreeNode
would be appropriate?
604f34d
to
f342fc3
Compare
efb9c1b
to
d56fe23
Compare
c668ceb
to
315b63d
Compare
…or dynamic data generation
…for easier tweaking
…(e.g. - things with no Kingdom)
…onal rank property
drop a @ts-nocheck on this file until I can untangle all the d3 types.
…th namespace import for consistency
…erit from there) to provide more contrast in species.
…n't that annoying
753db07
to
9c1d066
Compare
Awesome, works well @dannon! |
This provides the main visualization component for resolving #289. Separated color scheme options/discussion out per discussion on the call, which will be another PR.
There are several follow-ups to pursue but this is in a shape we can merge and move forward, with comments addressed.