Skip to content

Commit

Permalink
Merge pull request #2294 from duytnguyendtn/HideAssign
Browse files Browse the repository at this point in the history
Hide Centroid Redshift when lines aren't loaded
  • Loading branch information
duytnguyendtn authored Jul 12, 2023
2 parents a69493b + 388430c commit b18ed7f
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 47 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ New Features

- Viewer toolbar items hide themselves when they are not applicable. [#2284]

- Line Analysis "Redshift from Centroid" only visible when lines are loaded. [#2294]

Cubeviz
^^^^^^^

Expand Down
96 changes: 49 additions & 47 deletions jdaviz/configs/specviz/plugins/line_analysis/line_analysis.vue
Original file line number Diff line number Diff line change
Expand Up @@ -133,55 +133,57 @@
></v-progress-circular>
</div>

<j-plugin-section-header>Redshift from Centroid</j-plugin-section-header>
<v-row>
<j-docs-link>Assign the centroid reported above to the observed wavelength of a given line and set the resulting redshift. Lines must be loaded and plotted through the Line Lists plugin first.</j-docs-link>
</v-row>
<v-row class="row-no-outside-padding">
<v-col cols=2>
<j-tooltip tipid='plugin-line-analysis-sync-identify'>
<v-btn icon @click="() => sync_identify = !sync_identify" style="margin-top: 14px">
<img :class="sync_identify ? 'color-to-accent' : 'invert-if-dark'" :src="sync_identify ? sync_identify_icon_enabled : sync_identify_icon_disabled" width="20"/>
</v-btn>
</j-tooltip>
</v-col>
<v-col cols=10>
<v-select
:menu-props="{ left: true }"
attach
:items="line_items"
v-model="selected_line"
label="Line"
hint="Select reference line."
persistent-hint
></v-select>
</v-col>
</v-row>
<div v-if="line_items.length > 0">
<j-plugin-section-header>Redshift from Centroid</j-plugin-section-header>
<v-row>
<j-docs-link>Assign the centroid reported above to the observed wavelength of a given line and set the resulting redshift. Lines must be loaded and plotted through the Line Lists plugin first.</j-docs-link>
</v-row>
<v-row class="row-no-outside-padding">
<v-col cols=2>
<j-tooltip tipid='plugin-line-analysis-sync-identify'>
<v-btn icon @click="() => sync_identify = !sync_identify" style="margin-top: 14px">
<img :class="sync_identify ? 'color-to-accent' : 'invert-if-dark'" :src="sync_identify ? sync_identify_icon_enabled : sync_identify_icon_disabled" width="20"/>
</v-btn>
</j-tooltip>
</v-col>
<v-col cols=10>
<v-select
:menu-props="{ left: true }"
attach
:items="line_items"
v-model="selected_line"
label="Line"
hint="Select reference line."
persistent-hint
></v-select>
</v-col>
</v-row>

<v-row v-if="selected_line">
<v-text-field
:value='selected_line_redshift'
class="mt-0 pt-0"
type="number"
label="Redshift"
hint="Redshift that will be applied by assigning centroid to the selected line."
persistent-hint
disabled
></v-text-field>
</v-row>
<v-row v-if="selected_line">
<v-text-field
:value='selected_line_redshift'
class="mt-0 pt-0"
type="number"
label="Redshift"
hint="Redshift that will be applied by assigning centroid to the selected line."
persistent-hint
disabled
></v-text-field>
</v-row>

<v-row justify="end">
<j-tooltip tipid='plugin-line-analysis-assign'>
<v-btn
color="accent"
style="padding-left: 8px; padding-right: 8px;"
text
:disabled="!selected_line"
@click="line_assign">
Assign
</v-btn>
</j-tooltip>
</v-row>
<v-row justify="end">
<j-tooltip tipid='plugin-line-analysis-assign'>
<v-btn
color="accent"
style="padding-left: 8px; padding-right: 8px;"
text
:disabled="!selected_line"
@click="line_assign">
Assign
</v-btn>
</j-tooltip>
</v-row>
</div>
</div>
</j-tray-plugin>
</template>

0 comments on commit b18ed7f

Please sign in to comment.