Skip to content
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

Reimplement clade graph rendering #13

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

ivan-aksamentov
Copy link
Member

@ivan-aksamentov ivan-aksamentov commented Nov 2, 2022

This aims to reimplement rendering logic of the schema without using D3.js, such that we have more control on the schema layout.

  • remove d3.js DOM functions, use React instead
  • convert clades.json to a new format that can support recombination
  • reimplement graph construction (calculate node and edge positions), without using d3.js hierarchy functions: in particular allowing multiple parents (to show recombination relationships), and perhaps arbitrary graphs in general
  • render various attributes of nodes and edges (to be discussed) - using text, tooltips, graphics, color, animation etc
  • size nodes according to some metric (e.g. total number of observed sequences)
  • render the graph into an SVG file, for static usage
  • package the interactive React components into an NPM package, to be used in React apps where we currently use the static SVG (Nextclade, CoVariants, perhaps on Nextstrain.org somewhere as well)
  • CI: automatically release SVGs to GitHub Releases
  • CI: automatically release NPM package

@vercel
Copy link

vercel bot commented Nov 2, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
ncov-clades-schema ✅ Ready (Inspect) Visit Preview Nov 29, 2022 at 9:33AM (UTC)

@ivan-aksamentov ivan-aksamentov changed the title Reimplement rendering Reimplement clade graph rendering Nov 2, 2022
Here I  add a script to "flatten" the object hierarchy in `clades.json` into 2 lists: `nodes` and `edges` that represent the same hierarchy in a different way.

Every node now has an `id` (an arbitrary string). Every edge is directional and refers to its `source` and `target` noes by the node `id`. This representation will allow us to build arbitrary directed graphs instead of just trees (in particular, to allow showing recombinant relationships between clades)

I also split the composite Nextstrain name strings into the clade, lineages, who variant and other components. This should allows a richer display.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

1 participant