statgen / locuszoom

A Javascript/d3 embeddable plugin for interactively visualizing statistical genetic data from customizable sources.
https://statgen.github.io/locuszoom/
MIT License
156 stars 29 forks source link

"Annotation cache" so that rendering options can persist across render #178

Closed abought closed 4 years ago

abought commented 4 years ago

Purpose

We would like to provide user-driven controls for rendering a plot. ("click to toggle label"). Currently, a barrier is that there is no way to preserve single-element state across renderings.

This reorganizes some internal logic in data layers to support this, and fixes a bug where state references were broken when new state was applied.

A new section is added to track annotations: layer_state.extra_fields: {full_element_id: {key: value} }, with helpers methods to get and set values.

On rendering, this "annotation cache" is provided to calculations that handle scalable layout directives (eg point size, shape, label). This information represents internal state and is not available to templates.

Jan-29-2020 16-58-35