Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
artemix
yafits
Commits
11f05974
Commit
11f05974
authored
May 04, 2022
by
Moreau Nicolas
Browse files
Enables zoom on graph if spectroscopy menu is disabled
parent
88f37b19
Changes
2
Hide whitespace changes
Inline
Side-by-side
yafitsv/public/javascript/modules/olqv_linkedviews.js
View file @
11f05974
...
...
@@ -2194,56 +2194,50 @@ class SingleSpectrumViewer extends SpectrumViewer {
//this.series[1].update(self._getPoint(event.xAxis[0].value, 0));
},
selection
:
function
(
event
)
{
//console.clear();
// overplot selected area in blue
this
.
xAxis
[
0
].
update
({
plotBands
:
[{
from
:
event
.
xAxis
[
0
].
min
,
to
:
event
.
xAxis
[
0
].
max
,
color
:
'
rgba(68, 170, 213, .2)
'
}]
});
const
obsFreqMin
=
Math
.
min
(
event
.
xAxis
[
0
].
min
,
event
.
xAxis
[
0
].
max
);
const
obsFreqMax
=
Math
.
max
(
event
.
xAxis
[
0
].
min
,
event
.
xAxis
[
0
].
max
);
self
.
spectrumChart
.
obsFreqMin
=
obsFreqMin
;
self
.
spectrumChart
.
obsFreqMax
=
obsFreqMax
;
//toggle-lines-search
self
.
_spectroUI
.
hideEnergyGroupLines
();
if
(
self
.
linePlotter
===
null
)
{
self
.
linePlotter
=
new
LinePlotter
(
self
.
_spectroUI
);
}
// update global variable containing spectrum
let
xData
=
[];
for
(
let
i
=
0
;
i
<
this
.
series
[
0
].
data
.
length
;
i
++
)
{
xData
.
push
(
this
.
series
[
0
].
data
[
i
].
x
);
}
// if spectroUI is disabled simply zoom on selection
if
(
self
.
_spectroUI
.
isEnabled
()){
// overplot selected area in blue
this
.
xAxis
[
0
].
update
({
plotBands
:
[{
from
:
event
.
xAxis
[
0
].
min
,
to
:
event
.
xAxis
[
0
].
max
,
color
:
'
rgba(68, 170, 213, .2)
'
}]
});
const
obsFreqMin
=
Math
.
min
(
event
.
xAxis
[
0
].
min
,
event
.
xAxis
[
0
].
max
);
const
obsFreqMax
=
Math
.
max
(
event
.
xAxis
[
0
].
min
,
event
.
xAxis
[
0
].
max
);
self
.
spectrumChart
.
obsFreqMin
=
obsFreqMin
;
self
.
spectrumChart
.
obsFreqMax
=
obsFreqMax
;
//toggle-lines-search
self
.
_spectroUI
.
hideEnergyGroupLines
();
if
(
self
.
linePlotter
===
null
)
{
self
.
linePlotter
=
new
LinePlotter
(
self
.
_spectroUI
);
}
//let imin = getCalculatedIndex(event.xAxis[0].min);
//let imax = getCalculatedIndex(event.xAxis[0].max);
//self._vmin = event.xAxis[0].min;
//self._vmax = event.xAxis[0].max
;
// update global variable containing spectrum
let
xData
=
[]
;
//self.setChartTitle(self._getTopTitle(self._selectedSurface, self._toptitle_unit,
// self._vmin, self._vmax, imin, imax));
for
(
let
i
=
0
;
i
<
this
.
series
[
0
].
data
.
length
;
i
++
)
{
xData
.
push
(
this
.
series
[
0
].
data
[
i
].
x
);
}
if
(
self
.
_spectroUI
.
isEnabled
())
{
const
graphs
=
[
self
.
getSpectrumChartXAxis
()
];
try
{
self
.
linePlotter
.
loadAndPlotLines
(
obsFreqMin
,
obsFreqMax
,
graphs
);
}
catch
(
e
)
{
console
.
log
(
e
);
alert
(
"
Lines can not be displayed, please verify that redshift and/or velocity is defined.
"
);
if
(
self
.
_spectroUI
.
isEnabled
())
{
const
graphs
=
[
self
.
getSpectrumChartXAxis
()
];
try
{
self
.
linePlotter
.
loadAndPlotLines
(
obsFreqMin
,
obsFreqMax
,
graphs
);
}
catch
(
e
)
{
console
.
log
(
e
);
alert
(
"
Lines can not be displayed, please verify that redshift and/or velocity is defined.
"
);
}
}
return
false
;
}
return
false
;
}
}
...
...
yafitsv/views/olqv1d.ejs
View file @
11f05974
...
...
@@ -94,7 +94,7 @@
</button>
<div><a
href=
"/fits/browse"
target=
"_blank"
class=
"btn btn-link btn-sm"
>
Browse Fits files
</a></div>
<div><a
href=
"/fits/query"
target=
"_blank"
class=
"btn btn-link btn-sm"
>
Query Fits files
</a></div>
<div><a
data-toggle=
"modal"
data-target=
"#help-modal"
href=
'#'
>
Help (
3
D)
</a></div>
<div><a
data-toggle=
"modal"
data-target=
"#help-modal"
href=
'#'
>
Help (
1
D)
</a></div>
<img
src=
"../samphub.png"
alt=
"samp logo"
id=
"samp-img"
class=
"samp-img"
data-toggle=
"collapse"
data-target=
"#samp-registration"
title=
"Transfer data to another application with SAMP protocol"
aria-controls=
"samp-registration"
aria-expanded=
"false"
aria-label=
"Toggle navigation"
/>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment