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

Return Partial Data #44

Closed Frencil closed 6 years ago

Frencil commented 8 years ago

If a data layer is requesting data from multiple sources and only one of those sources fails, try to find a way to still display what data was received.

A good example of where this would help: Positions data layer that pulls down positions from one source and LD from another. Since the LD data is only used to color positions, and the coloring function will return a default color if passed an undefined value, ideally it would be nice to still see the default-colored positions data if the LD source is not responding.

In practice this may be very difficult to pull off since the data layer makes one request and LocusZoom.Data does the logic to generate actual requests to each source necessary given the fields requested. Right now it's an all-or-none type thing, where either all data is returned or an error is passed through. To return partial data means potentially returning both data and errors in some cases, which does not have clearly defined behavior.

abought commented 6 years ago

The LD example is a very good one, because it revealed some subtle distinctions between errors and dependencies.

Addressed by https://github.com/abought/locuszoom/blob/619da458d2f4e663d1256515af7ea3b608d442f9/assets/js/app/Data.js#L639

Design solution record as follows: