forked from astropy/astrowidgets
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
"""Module containing ``astrowidgets`` implemented with ``glue-jupyter`` | ||
(that uses ``bqplot``) backend. | ||
For this to work, ``astrowidgets`` must be installed along with the optional | ||
dependencies specified for the ``glue-jupyter`` (a.k.a. Glupyter or | ||
``glupyter``) backend; e.g.,:: | ||
pip install 'astrowidgets[glupyter]' | ||
""" | ||
from glue_jupyter import jglue | ||
|
||
from astrowidgets.core import BaseImageWidget | ||
|
||
__all__ = ['ImageWidget'] | ||
|
||
|
||
class ImageWidget(BaseImageWidget): | ||
"""Image widget for Jupyter notebook using ``glue-jupyter``/``bqplot`` | ||
viewer. | ||
Parameters | ||
---------- | ||
kwargs : dict | ||
See `~astrowidgets.core.BaseImageWidget`. | ||
""" | ||
def __init__(self, **kwargs): | ||
super().__init__(**kwargs) | ||
|
||
self._app = jglue() | ||
self._viewer = self._app.imshow() | ||
|
||
# UNTIL HERE -- imshow errors out without data | ||
# TODO: This builds on PR 126. Example notebook in test_data/ztmp... | ||
|
||
@property | ||
def viewer(self): | ||
self._viewer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,8 @@ ginga = | |
ginga | ||
pillow | ||
aggdraw | ||
glupyter = | ||
glue-jupyter | ||
test = | ||
pytest-astropy | ||
pytest-cov | ||
|