Skip to content

Commit

Permalink
Have Pixel not jump around
Browse files Browse the repository at this point in the history
  • Loading branch information
pllim committed Dec 1, 2021
1 parent b6a098d commit 90b2780
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 9 additions & 0 deletions jdaviz/configs/imviz/plugins/coords_info/coords_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,18 @@ class CoordsInfo(TemplateMixin):
template_file = __file__, "coords_info.vue"
pixel = Unicode("").tag(sync=True)
value = Unicode("").tag(sync=True)
world_label_prefix = Unicode("\u00A0").tag(sync=True)
world_label_icrs = Unicode("\u00A0").tag(sync=True)
world_label_deg = Unicode("\u00A0").tag(sync=True)
world_ra = Unicode("").tag(sync=True)
world_dec = Unicode("").tag(sync=True)
world_ra_deg = Unicode("").tag(sync=True)
world_dec_deg = Unicode("").tag(sync=True)

def reset_coords_display(self):
self.world_label_prefix = '\u00A0'
self.world_label_icrs = '\u00A0'
self.world_label_deg = '\u00A0'
self.world_ra = ''
self.world_dec = ''
self.world_ra_deg = ''
Expand All @@ -33,6 +39,9 @@ def set_coords(self, sky):
if "nan" in (world_ra, world_dec, world_ra_deg, world_dec_deg):
self.reset_coords_display()
else:
self.world_label_prefix = 'World'
self.world_label_icrs = '(ICRS)'
self.world_label_deg = '(deg)'
self.world_ra = world_ra
self.world_dec = world_dec
self.world_ra_deg = world_ra_deg
Expand Down
6 changes: 3 additions & 3 deletions jdaviz/configs/imviz/plugins/coords_info/coords_info.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
</td>
</tr>
<tr>
<td width="42"><b v-if="world_ra">World</b></td>
<td width="42"><b>{{ world_label_prefix }}</b></td>
<td width="115">{{ world_ra }}</td>
<td width="120">{{ world_dec }}</td>
<td><div v-if="world_ra">(ICRS)</div></td>
<td>{{ world_label_icrs }}</td>
</tr>
<tr>
<td width="42"></td>
<td width="115">{{ world_ra_deg }}</td>
<td width="120">{{ world_dec_deg }}</td>
<td><div v-if="world_ra">(deg)</div></td>
<td>{{ world_label_deg }}</td>
</tr>
</table>
</div>
Expand Down

0 comments on commit 90b2780

Please sign in to comment.