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

[refactor] Streamline rendering pipeline #211

Closed
3 tasks
abought opened this issue Oct 14, 2020 · 0 comments
Closed
3 tasks

[refactor] Streamline rendering pipeline #211

abought opened this issue Oct 14, 2020 · 0 comments

Comments

@abought
Copy link
Member

abought commented Oct 14, 2020

Larger items split from #208.

Purpose

The current LocusZoom rendering process has become convoluted as features have been added. Certain functions depend heavily on global state, and annotations and filtering were grafted on after the fact. This makes data layer rendering operations hard to debug or extend with new features. (eg #206 )

This ticket will track the refactor of the internal rendering logic, breaking it into conceptual pieces with a more functional style (where possible, have data passed around as function arguments instead of saved as global references).

Planned architecture

The rendering process will be broken into three phases:

  1. Data: retrieve the data from the adapter, then perform any adjustments needed for this data layer, such as:
  • Retrieve data from the adapter (this is done once per reMap; it is not done on every render)
  • Add synthetic fields (category scatter x position, gene extent, etc)
  • Generate basic summary info (like axis extents and scatter tick labels) from the full (not filtered) dataset
    • Some data layers might want to customize whether or not filters apply to tick labels
  • Apply user-filters to determine which data elements are eligible for rendering
  • After filtering, apply coalescing operations to limit rendered set based on viewable area (for performance optimizations)
  • Once the final set of rendered points is ready, apply "custom" fields and "data methods" used by rendering logic (generate references like getDataLayer, getPlot, toHTML; also cache frequently recomputed values like getElementId).
  1. Display phase
  • Clear any previous markings (labels, tooltips, etc)
  • Render elements, bounding boxes, & hitareas. Apply event listeners as appropriate.
  • Render markings (tooltips, labels) based on saved state. This should take the point annotation cache into account. (eg, user-selected labels)
  1. Interaction phase (updates that happen after initial render)
  • Respond to event listeners to apply point states such as "highlighted", "selected", "tooltip". Note that some interactions are "exclusive", so this needs to know about all states (not just the current element).
  • Apply special events such as "highlight matching items in another data layer"

TODO

  • Internal rework above
  • Add unit tests around discrete render steps
  • Investigate panel sizing logic, which appears to be iterative with multiple cycles
@abought abought closed this as completed Dec 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant