Closed Carifio24 closed 1 year ago
The viewers don't yet implement everything that they could (that is, everything that the exporters support), but they do implement almost everything exposed through the glue-jupyter UI, so I think that's a good start.
@astrofrog Would be interested to hear any thoughts you have on either part of this PR (refactoring to use state, and the viewers)
This PR takes a first step at addressing #3 by providing basic POC implementations of Plotly-based 2D scatter and histogram Jupyter viewers. Additionally, this PR contains some refactoring aimed at making as much of the code be frontend-agnostic as possible - in addition to powering Plotly viewers, it would also be nice to reuse much of what we have to make exporters for other frontends (i.e. bqplot). I started with the 2D scatter and histogram viewers because they're pretty standard visualizations, and we're interested in potentially using these with CosmicDS.
As of now, these viewers are a work in progress and undoubtedly still have some issues. The current state of things looks like this:
General viewers:
Scatter viewer:
Histogram viewer:
Normalized and cumulative settings work fine when set directly, but the limits don't come out right when they're set from the widget(?)This seems to be an issue with the widget, as the same happens with the bqplot viewerGenerally speaking, most of the logic for representing these items in Plotly traces has been worked out in the static exporters, so it's just a matter of making these traces respond to updates in the state.
If someone is interested in trying these out:
Install this branch:
pip install git+https://github.com/Carifio24/glue-plotly@viewers
Here's a sample snippet to run in a Jupyter notebook: