Skip to content

Commit

Permalink
Merge pull request #4 from kecnry/pixel-div-vert-centered
Browse files Browse the repository at this point in the history
Attempt to fix vertical padding on pixel coordinate div in imviz
  • Loading branch information
pllim authored Dec 1, 2021
2 parents 870d92b + 90b2780 commit 4120379
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 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
8 changes: 4 additions & 4 deletions jdaviz/configs/imviz/plugins/coords_info/coords_info.vue
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<template>
<div v-if="pixel" style="white-space: nowrap;">
<div v-if="pixel" style="white-space: nowrap; line-height: 14pt; margin: 0; position: absolute; top: 50%; transform: translateY(-50%); -ms-transform: translateY(-50%);">
<table>
<tr>
<td colspan="4">
<b v-if="pixel">Pixel </b>{{ pixel }}&nbsp;&nbsp;<b v-if="value">Value </b>{{ value }}
</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 4120379

Please sign in to comment.