Commit 11f05974 authored by Moreau Nicolas's avatar Moreau Nicolas
Browse files

Enables zoom on graph if spectroscopy menu is disabled

parent 88f37b19
......@@ -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;
}
}
......
......@@ -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 (3D)</a></div>
<div><a data-toggle="modal" data-target="#help-modal" href='#'>Help (1D)</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" />
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment