Skip to content

Commit

Permalink
Coverage filtering toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
duytnguyendtn committed Jul 17, 2024
1 parent cdcaa1c commit a4cb32f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
5 changes: 5 additions & 0 deletions jdaviz/components/tooltip.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ const tooltips = {
'plugin-dq-show-all': 'Show all quality flags',
'plugin-dq-hide-all': 'Hide all quality flags',
'plugin-dq-color-picker': 'Change the color of this DQ flag',
'plugin-vo-filter-coverage': `Only show surveys that report coverage within specified radius of provided coordinates. Queries may take longer to process<br /><br />
<div style="border: 1px solid gray;" class="pa-2">
<strong>Note:</strong>
Surveys which have not implemented coverage information will also be excluded. If you are expecting a survey that doesn't appear, try disabling coverage filtering.
</div>`
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class VoPlugin(PluginTemplateMixin, AddResultsMixin, TableMixin):
viewer_selected = Unicode().tag(sync=True)

wavebands = List().tag(sync=True)
resource_filter_coverage = Bool(True).tag(sync=True)
resources = List([]).tag(sync=True)
resources_loading= Bool(False).tag(sync=True)

Expand Down Expand Up @@ -137,7 +138,7 @@ def vue_query_registry_resources(self, event=None):

try:
registry_args = [registry.Servicetype("sia"), registry.Waveband(self.waveband_selected)]
if coord != None:
if coord != None and self.resource_filter_coverage:
registry_args.append(registry.Spatial(coord, self.radius_deg, intersect="overlaps"))
self._full_registry_results = registry.search(*registry_args)
self.resources = list(self._full_registry_results.getcolumn("short_name"))
Expand Down
23 changes: 20 additions & 3 deletions jdaviz/configs/default/plugins/virtual_observatory/vo_plugin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,17 @@


<j-plugin-section-header>Survey Collections</j-plugin-section-header>
<v-row>
<j-tooltip tipid='plugin-vo-filter-coverage'>
<span>
<v-btn icon @click.stop="resource_filter_coverage = !resource_filter_coverage">
<v-icon>mdi-filter{{ resource_filter_coverage ? '' : '-remove' }}</v-icon>
</v-btn>
Filter by Coverage
</span>
</j-tooltip>
</v-row>

<v-row>
<v-select
:menu-props="{ left: true }"
Expand Down Expand Up @@ -89,9 +100,15 @@
</v-row>

<v-row class="row-no-outside-padding">
<v-col>
<v-btn color="primary" :loading="results_loading" text @click="query_resource">Query Archive</v-btn>
</v-col>
<v-col>
<v-btn
block
color="primary"
:loading="results_loading"
:disabled="this.resource_selected === null"
text
@click="query_resource">Query Archive</v-btn>
</v-col>
</v-row>

<jupyter-widget :widget="table_widget"></jupyter-widget>
Expand Down

0 comments on commit a4cb32f

Please sign in to comment.