From 87ea648bf08a61cffc7d73aea7d79c6d5574cab2 Mon Sep 17 00:00:00 2001 From: Pey Lian Lim <2090236+pllim@users.noreply.github.com> Date: Wed, 14 Jul 2021 18:03:32 -0400 Subject: [PATCH] WIP: Subset control plugin [ci skip] --- jdaviz/configs/imviz/imviz.yaml | 2 + jdaviz/configs/imviz/plugins/__init__.py | 1 + .../imviz/plugins/subset_control/__init__.py | 1 + .../plugins/subset_control/subset_control.py | 20 +++++++++ .../plugins/subset_control/subset_control.vue | 41 +++++++++++++++++++ 5 files changed, 65 insertions(+) create mode 100644 jdaviz/configs/imviz/plugins/subset_control/__init__.py create mode 100644 jdaviz/configs/imviz/plugins/subset_control/subset_control.py create mode 100644 jdaviz/configs/imviz/plugins/subset_control/subset_control.vue diff --git a/jdaviz/configs/imviz/imviz.yaml b/jdaviz/configs/imviz/imviz.yaml index 665817043f..94adfa5cb1 100644 --- a/jdaviz/configs/imviz/imviz.yaml +++ b/jdaviz/configs/imviz/imviz.yaml @@ -17,6 +17,8 @@ toolbar: - g-subset-tools - g-image-viewer-creator - g-coords-info +tray: + - imviz-subset-control viewer_area: - container: col children: diff --git a/jdaviz/configs/imviz/plugins/__init__.py b/jdaviz/configs/imviz/plugins/__init__.py index b55503e340..b3a084452a 100644 --- a/jdaviz/configs/imviz/plugins/__init__.py +++ b/jdaviz/configs/imviz/plugins/__init__.py @@ -3,3 +3,4 @@ from .image_viewer_creator import * # noqa from .parsers import * # noqa from .coords_info import * # noqa +from .subset_control import * # noqa diff --git a/jdaviz/configs/imviz/plugins/subset_control/__init__.py b/jdaviz/configs/imviz/plugins/subset_control/__init__.py new file mode 100644 index 0000000000..c5ec28c370 --- /dev/null +++ b/jdaviz/configs/imviz/plugins/subset_control/__init__.py @@ -0,0 +1 @@ +from .subset_control import * # noqa diff --git a/jdaviz/configs/imviz/plugins/subset_control/subset_control.py b/jdaviz/configs/imviz/plugins/subset_control/subset_control.py new file mode 100644 index 0000000000..065b62fdee --- /dev/null +++ b/jdaviz/configs/imviz/plugins/subset_control/subset_control.py @@ -0,0 +1,20 @@ +from jdaviz.core.registries import tray_registry +from jdaviz.core.template_mixin import TemplateMixin +from jdaviz.utils import load_template + +__all__ = ['SubsetControl'] + + +@tray_registry('imviz-subset-control', label="Subset Control") +class SubsetControl(TemplateMixin): + template = load_template("subset_control.vue", __file__).tag(sync=True) + + # TODO: + # 1. Let user select which subset to operate on. + # 2. Hide angle field when it does not make sense (e.g., circle) + # 3. Grab new values from user inputs + # 4. Apply new values to Subset + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + diff --git a/jdaviz/configs/imviz/plugins/subset_control/subset_control.vue b/jdaviz/configs/imviz/plugins/subset_control/subset_control.vue new file mode 100644 index 0000000000..d4267bdaa9 --- /dev/null +++ b/jdaviz/configs/imviz/plugins/subset_control/subset_control.vue @@ -0,0 +1,41 @@ +