Skip to content

Commit

Permalink
adding gototab in explore tables (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
havok2063 authored Sep 10, 2024
1 parent eaf075c commit e637e0b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/views/Explore.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
slim
rounded="0"
class="text-none"
@click="gotoTab(item)"
>{{ item.text }}<v-icon @click.stop="removeTab(item)">mdi-close</v-icon>
</v-tab>
</template>
Expand Down Expand Up @@ -92,6 +93,16 @@ const childRefs = ref([])
let aladin: any = null
let objectSelected = ref(false)
// compute average of an array
const average = array => array.reduce((a, b) => JSON.parse(a) + JSON.parse(b)) / array.length;
function gotoTab(item) {
// go to the tab's data average RA, Dec position
const ra = average(item.items.map(ii => ii.ra_sdss_id))
const dec = average(item.items.map(ii => ii.dec_sdss_id))
store.aladin.gotoRaDec(ra, dec)
}
function setupAladin() {
// set up the main aladin lite viewer
A.init.then(() => {
Expand Down

0 comments on commit e637e0b

Please sign in to comment.