statgen / locuszoom

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

Ephemeral panels #54

Closed Frencil closed 8 years ago

Frencil commented 8 years ago

What

This branch refactors the formerly very basic panel geometry logic into something that allows for the dynamic adding and removing of panels with top-level API calls.

Before

Before this branch panels behaved more or less like this:

As of this branch panel geometry logic has been refactored to meet a more specific use case. In places it is more restrictive and in others it's more liberal. Now panels can:

To see the net result of this branch in action do the following:

This is a big and necessary step toward supporting multiple phenotypes in the Broad Portal, LocusZoom's current primary consumer. The work done on this branch, however, is a big benefit to all future LocusZoom implementations that will have cause to dynamically add and remove panels based on user input.

Testing

There was a significant amount of test refactoring and expansion done on this branch as some previously tested-for behavior changed. In general the tests in test/Instance.js tend to cover many of the changed and new behaviors, including the critical addPanel() and removePanel() Instance-level methods.

Marked as active development while ironing out any lingering bugs. Scope should probably be capped at this point and we can discuss where best to go from here.