Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to fix vertical padding on pixel coordinate div in imviz #4

Merged
merged 2 commits into from
Dec 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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