biocore / emperor

Emperor a tool for the analysis and visualization of large microbial ecology datasets
http://biocore.github.io/emperor/
Other
52 stars 50 forks source link

ENH: export plot to vega editor #714

Closed thermokarst closed 5 years ago

thermokarst commented 5 years ago

As per our offline discussions @ElDeveloper, this changeset attempts to add preliminary "Open in Vega Editor" functionality. Vega is a visualization grammar, capable of rendering canvas and SVG plots in the browser, as well as spec support in tools like R (AFAIK).

Sample QZV based on QIIME 2 MP tutorial subsampled data.

Sample Spec from QZV above.

This changeset is mostly just a proof-of-concept demonstration, and will need to be cleaned up, documented, and tested as necessary, but I think I will need a bit of help on that end. Overall, the design mostly works by creating a snapshot of the current THREE.js scene, and then applying the necessary transforms to build a vega-compliant specification. Thanks for entertaining the idea of something like this!

ElDeveloper commented 5 years ago

@thermokarst! This is great! I think this will be of great use! Being that 2019.4 is coming soon, perhaps we can include this with an "experimental", and start gathering some user feedback for the next release cycle. As you noted the main thing missing would be unit tests, but I am sure we can figure something out.

The failures are unrelated to this PR and should be fixed by #713

thermokarst commented 5 years ago

Hey @ElDeveloper, just pushed up a few changes to hide behind a feature flag. I put it under a general enable_experimental kwarg, but can change to whatever you wish. I think I will take another cruise through things tomorrow, but feel free to push up any changes you wish to see in the meantime. Thanks!