Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tidy up how layout is defined for viewers and provide a way to customize #108

Merged
merged 9 commits into from
May 24, 2019

Conversation

astrofrog
Copy link
Member

@astrofrog astrofrog commented May 23, 2019

This tidies up a lot of the code that does the layout for the viewers to be defined in the base class for all Jupyter-based viewers. In addition, this defines a public API for accessing the components for any given viewer, and provides a way to register a custom 'layout factory' that defines a new default layout for viewers, for example:

from ipywidgets import VBox
from glue_jupyter import set_layout_factory

def simple_viewer_layout(viewer):
    return VBox([viewer.toolbar_selection_tools, viewer.figure_widget])

set_layout_factory(simple_viewer_layout)

This will make it easier to experiment with ipyvuetify layouts.

Finally, this creates a new widget for editing layer options which consists of a way to select the current layer (for now a dropdown) and shows the options for that specific layer. In future we can improve this, but at least this provides a short-term fix for #84 by avoiding having many tabs when there are a lot of layers present.

@codecov
Copy link

codecov bot commented May 24, 2019

Codecov Report

Merging #108 into master will decrease coverage by 0.21%.
The diff coverage is 89.62%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #108      +/-   ##
==========================================
- Coverage   92.15%   91.94%   -0.22%     
==========================================
  Files          68       69       +1     
  Lines        2946     2980      +34     
==========================================
+ Hits         2715     2740      +25     
- Misses        231      240       +9
Impacted Files Coverage Δ
glue_jupyter/matplotlib/base.py 100% <100%> (ø) ⬆️
glue_jupyter/bqplot/tests/test_bqplot.py 100% <100%> (ø) ⬆️
..._jupyter/ipyvolume/common/viewer_options_widget.py 100% <100%> (ø) ⬆️
glue_jupyter/ipyvolume/tests/test_ipyvolume.py 100% <100%> (ø) ⬆️
glue_jupyter/ipyvolume/volume/viewer.py 100% <100%> (ø) ⬆️
...lue_jupyter/common/state_widgets/viewer_profile.py 100% <100%> (ø) ⬆️
...e_jupyter/common/state_widgets/viewer_histogram.py 100% <100%> (ø) ⬆️
glue_jupyter/ipyvolume/scatter/viewer.py 100% <100%> (ø) ⬆️
glue_jupyter/bqplot/common/viewer.py 85.5% <100%> (-2.59%) ⬇️
glue_jupyter/ipyvolume/common/tools.py 97.29% <100%> (ø) ⬆️
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e42d99c...086e63d. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant