Skip to content

Commit

Permalink
WIP: Subset control plugin [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
pllim committed Jul 14, 2021
1 parent 915c3c9 commit 7434300
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 0 deletions.
2 changes: 2 additions & 0 deletions jdaviz/configs/imviz/imviz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ toolbar:
- g-subset-tools
- g-image-viewer-creator
- g-coords-info
tray:
- imviz-subset-control
viewer_area:
- container: col
children:
Expand Down
1 change: 1 addition & 0 deletions jdaviz/configs/imviz/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
from .image_viewer_creator import * # noqa
from .parsers import * # noqa
from .coords_info import * # noqa
from .subset_control import * # noqa
1 change: 1 addition & 0 deletions jdaviz/configs/imviz/plugins/subset_control/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .subset_control import * # noqa
20 changes: 20 additions & 0 deletions jdaviz/configs/imviz/plugins/subset_control/subset_control.py
Original file line number Diff line number Diff line change
@@ -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)

41 changes: 41 additions & 0 deletions jdaviz/configs/imviz/plugins/subset_control/subset_control.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<template>
<v-card flat tile>
<v-container>
<v-row>
<v-col>
<v-text-field
ref="new_subset_angle"
label="New Angle"
v-model="new_subset_angle"
hint="New angle for subset."
persistent-hint
disabled="True"
></v-text-field>
</v-col>
</v-row>
<v-row>
<v-col>
<v-text-field
ref="new_subset_x"
label="New X"
v-model="new_subset_x"
hint="New X for subset."
persistent-hint
disabled="True"
></v-text-field>
</v-col>
</v-row>
<v-row>
<v-col>
<v-text-field
ref="new_subset_y"
label="New Y"
v-model="new_subset_y"
hint="New Y for subset."
persistent-hint
disabled="True"
</v-col>
</v-row>
</v-container>
</v-card>
</template>

0 comments on commit 7434300

Please sign in to comment.