forked from galaxyproject/galaxy
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request galaxyproject#17002 from esg-epfl-apc/fix-visualiz…
…ation-plugin Fix for fits_image_viewer visualization plugin
- Loading branch information
Showing
3 changed files
with
40 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 30 additions & 6 deletions
36
config/plugins/visualizations/fits_image_viewer/src/script.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,31 @@ | ||
let aladin; | ||
var aladin; | ||
|
||
A.init.then(() => { | ||
aladin = A.aladin('#aladin-lite-div', {showCooGridControl: true}); | ||
aladin.displayFITS(file_url) | ||
aladin.showCooGrid(true); | ||
}); | ||
function initializeAladinLite() { | ||
A.init.then(() => { | ||
aladin = A.aladin('#aladin-lite-div', {showCooGridControl: true}); | ||
aladin.displayFITS(fileUrl) | ||
aladin.showCooGrid(true); | ||
}); | ||
} | ||
|
||
function localScriptLoadingError() { | ||
addScriptToHead(appRoot+aladinLiteScriptAlternativeLocation); | ||
} | ||
|
||
function cdnLoadingError() { | ||
addScriptToHead(appRoot+aladinLiteScriptLocation, localScriptLoadingError); | ||
} | ||
|
||
function addScriptToHead(url, onerrorFunction) { | ||
const scriptToAdd = document.createElement("script"); | ||
scriptToAdd.onload = initializeAladinLite; | ||
|
||
if(onerrorFunction) { | ||
scriptToAdd.onerror = onerrorFunction | ||
} | ||
|
||
document.head.appendChild(scriptToAdd); | ||
scriptToAdd.src = url; | ||
} | ||
|
||
addScriptToHead(aladinLiteCDNUrl, cdnLoadingError); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters