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

Allow scale functions to take arbitrarily many fields #95

Closed Frencil closed 7 years ago

Frencil commented 7 years ago

See this issue for context. The use case here is that the point shape on a scatter plot (something that can already be mapped to scale functions) needs to do some logic that conditions on more than one field at a time, and presently scale functions only allow one field to be passed. A general solution would be for scale functions to take an array of field names, an entire data element, or both.

Frencil commented 7 years ago

Resolved on master (to go with v0.5.6 release) - solution was to pass entire data element to scale function in the absence of a defined field in the part of the layout that invokes the scale function. This solves the issue for PheWeb using a scale function to do a more complex conditional for effect direction as shown in the test for this fix which implements just such a custom scale function.

pjvandehaar commented 7 years ago

Awesome, I'll try this out.