mirror of
https://github.com/cds-astro/aladin-lite.git
synced 2026-04-29 04:08:58 -07:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3476c535e6 | ||
|
|
af3f844bcc | ||
|
|
6dc1722cd2 | ||
|
|
9a47a6b11d | ||
|
|
543fc7ef8e |
@@ -8,6 +8,8 @@
|
||||
|
||||
### 3.8.0
|
||||
|
||||
|
||||
* [fix] Fix shape hover colors when overlay uses named color (increaseBrightness() accepts names now) <https://github.com/cds-astro/aladin-lite/issues/355>
|
||||
* [feat] Selected and hovered items (shapes, sources, ...) are rendered at last. <https://github.com/cds-astro/aladin-lite/issues/337>
|
||||
* [feat] Add selectionLineWidth option for shapes and catalogs. <https://github.com/cds-astro/aladin-lite/pull/354>
|
||||
* [fix] horizontal/vertical overlay lines appearing correctly <https://github.com/cds-astro/aladin-lite/issues/334>
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
"dateModified": "2023-01-31",
|
||||
"issueTracker": "https://github.com/cds-astro/aladin-lite/issues",
|
||||
"name": "Aladin Lite",
|
||||
"version": "3.8.0-beta",
|
||||
"softwareVersion": "3.8.0-beta",
|
||||
"version": "3.8.1",
|
||||
"softwareVersion": "3.8.1",
|
||||
"description": "An astronomical HiPS visualizer in the browser.",
|
||||
"identifier": "10.5281/zenodo.7638833",
|
||||
"applicationCategory": "Astronomy, Visualization",
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
<script type="module">
|
||||
import A from '../src/js/A.js';
|
||||
A.init.then(() => {
|
||||
let aladin = A.aladin('#aladin-lite-div', {target: "23 28 32.46 -00 10 38.9", fov: 4, projection: "AIT"});
|
||||
let aladin = A.aladin('#aladin-lite-div', {survey: ["lksldf", 'ljkjsdf', "https://alasky.cds.unistra.fr/HIPS3D/LGLBSHI16"], target: "23 28 32.46 -00 10 38.9", fov: 4, projection: "AIT"});
|
||||
|
||||
let hsc = aladin.newImageSurvey("P/HSC/DR2/deep/g", {colormap:"Purples", imgFormat: "fits"});
|
||||
aladin.setBaseImageLayer(hsc);
|
||||
//let hsc = aladin.newImageSurvey("P/HSC/DR2/deep/g", {colormap:"Purples", imgFormat: "fits"});
|
||||
//aladin.setBaseImageLayer(hsc);
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
<div id="al1" style="width: 200px; height: 200px">
|
||||
<div id="al1" style="width: 512px; height: 512px">
|
||||
</div>
|
||||
<div id="al2" style="width: 200px; height: 200px">
|
||||
<div id="al2" style="width: 512px; height: 512px">
|
||||
</div>
|
||||
|
||||
<script type="module">
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<meta name="viewport" content="width=device-width, height=device-height, maximum-scale=1.0, initial-scale=1.0, user-scalable=no">
|
||||
<script type="text/javascript" src="./../dist/aladin.umd.cjs" charset="utf-8"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="aladin-lite-div" style="width: 500px; height: 500px"></div>
|
||||
|
||||
<script type="text/javascript" src="./../dist/aladin.umd.cjs" charset="utf-8"></script>
|
||||
<script type="text/javascript">
|
||||
var aladin;
|
||||
A.init.then(() => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"homepage": "https://aladin.cds.unistra.fr/",
|
||||
"name": "aladin-lite",
|
||||
"type": "module",
|
||||
"version": "3.8.1",
|
||||
"version": "3.8.2",
|
||||
"description": "An astronomical HiPS visualizer in the browser",
|
||||
"author": "Thomas Boch and Matthieu Baumann",
|
||||
"license": "GPL-3",
|
||||
|
||||
@@ -3,7 +3,7 @@ name = "aladin-lite"
|
||||
description = "Aladin Lite v3 introduces a new graphical engine written in Rust with the use of WebGL"
|
||||
license = "BSD-3-Clause"
|
||||
repository = "https://github.com/cds-astro/aladin-lite"
|
||||
version = "3.8.1"
|
||||
version = "3.8.2"
|
||||
authors = [ "baumannmatthieu0@gmail.com", "matthieu.baumann@astro.unistra.fr",]
|
||||
edition = "2018"
|
||||
|
||||
@@ -63,7 +63,7 @@ path = "./al-api"
|
||||
|
||||
[dependencies.web-sys]
|
||||
version = "0.3.56"
|
||||
features = [ "console", "CssStyleDeclaration", "Document", "Element", "HtmlCollection", "CustomEvent", "CustomEventInit", "HtmlElement", "HtmlImageElement", "HtmlCanvasElement", "Blob", "Url", "ImageBitmap", "ImageData", "CanvasRenderingContext2d", "WebGlBuffer", "WebGlContextAttributes", "WebGlFramebuffer", "WebGlProgram", "WebGlShader", "WebGlUniformLocation", "WebGlTexture", "WebGlActiveInfo", "Headers", "Window", "Request", "RequestInit", "RequestMode", "RequestCredentials", "Response", "XmlHttpRequest", "XmlHttpRequestResponseType", "PerformanceTiming", "Performance", "Url", "ReadableStream", "File", "FileList", "OffscreenCanvas", "OffscreenCanvasRenderingContext2d", "Worker", "WorkerOptions", "WorkerType"]
|
||||
features = [ "console", "CssStyleDeclaration", "Document", "Element", "HtmlCollection", "CustomEvent", "CustomEventInit", "HtmlElement", "HtmlImageElement", "HtmlCanvasElement", "Blob", "Url", "ImageBitmap", "ImageData", "CanvasRenderingContext2d", "WebGlBuffer", "WebGlContextAttributes", "WebGlFramebuffer", "WebGlProgram", "WebGlShader", "WebGlUniformLocation", "WebGlTexture", "WebGlActiveInfo", "Headers", "Window", "Request", "RequestInit", "RequestMode", "RequestCredentials", "Response", "XmlHttpRequest", "XmlHttpRequestResponseType", "PerformanceTiming", "Performance", "Url", "ReadableStream", "File", "FileList", "OffscreenCanvas", "OffscreenCanvasRenderingContext2d", "Worker", "WorkerOptions", "WorkerType",]
|
||||
|
||||
[dev-dependencies.image-decoder]
|
||||
package = "image"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "al-api"
|
||||
version = "3.8.1"
|
||||
version = "3.8.2"
|
||||
authors = ["baumannmatthieu0@gmail.com", "matthieu.baumann@astro.unistra.fr"]
|
||||
edition = "2018"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "al-core"
|
||||
version = "3.8.1"
|
||||
version = "3.8.2"
|
||||
authors = ["baumannmatthieu0@gmail.com", "matthieu.baumann@astro.unistra.fr"]
|
||||
edition = "2018"
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -29,7 +29,6 @@
|
||||
* Author: Thomas Boch[CDS]
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
import { MOC } from "./MOC.js";
|
||||
import { GraphicOverlay } from "./Overlay.js";
|
||||
import { Circle } from "./shapes/Circle.js";
|
||||
@@ -58,7 +57,6 @@ import aladinCSS from './../css/aladin.css?inline';
|
||||
///////////////////////////////
|
||||
/////// Aladin Lite API ///////
|
||||
///////////////////////////////
|
||||
|
||||
/**
|
||||
* @namespace A
|
||||
* @description Aladin Lite API namespace for creating celestial objects.
|
||||
@@ -1062,6 +1060,7 @@ A.Utils = AladinUtils;
|
||||
* console.error('Error initializing Aladin Lite:', error);
|
||||
* });
|
||||
*/
|
||||
|
||||
A.init = (async () => {
|
||||
const isWebGL2Supported = document
|
||||
.createElement('canvas')
|
||||
@@ -1076,6 +1075,6 @@ A.init = (async () => {
|
||||
// According to caniuse, https://caniuse.com/webgl2, webgl2 is supported by 89% of users
|
||||
throw "WebGL2 not supported by your browser";
|
||||
}
|
||||
})();
|
||||
})()
|
||||
|
||||
export default A;
|
||||
|
||||
@@ -511,7 +511,7 @@ export let Aladin = (function () {
|
||||
|
||||
this._setupUI(options);
|
||||
|
||||
ALEvent.FAVORITE_HIPS_LIST_UPDATED.dispatchedTo(document.body, this.hipsFavorites);
|
||||
ALEvent.FAVORITE_HIPS_LIST_UPDATED.dispatchedTo(document, this.hipsFavorites);
|
||||
|
||||
if (options.survey) {
|
||||
if (Array.isArray(options.survey)) {
|
||||
@@ -1819,7 +1819,7 @@ export let Aladin = (function () {
|
||||
if (idx >= 0) {
|
||||
this.hipsFavorites.splice(idx, 1);
|
||||
// Send a change of favorites for the UI selector to adapt their optional list
|
||||
ALEvent.FAVORITE_HIPS_LIST_UPDATED.dispatchedTo(document.body, this.hipsFavorites);
|
||||
ALEvent.FAVORITE_HIPS_LIST_UPDATED.dispatchedTo(document, this.hipsFavorites);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1856,7 +1856,7 @@ export let Aladin = (function () {
|
||||
})
|
||||
|
||||
// send the final event
|
||||
ALEvent.FAVORITE_HIPS_LIST_UPDATED.dispatchedTo(document.body, this.hipsFavorites);
|
||||
ALEvent.FAVORITE_HIPS_LIST_UPDATED.dispatchedTo(document, this.hipsFavorites);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -126,10 +126,10 @@ export let DefaultActionsForContextMenu = (function () {
|
||||
},
|
||||
subMenu: [
|
||||
{
|
||||
label: 'FITS image', action(o) {
|
||||
label: 'Load image', action(o) {
|
||||
let input = document.createElement('input');
|
||||
input.type = 'file';
|
||||
input.accept = ".fits";
|
||||
input.accept = ['.fits', '.png', '.jpg'];
|
||||
input.onchange = _ => {
|
||||
let files = Array.from(input.files);
|
||||
|
||||
@@ -138,14 +138,16 @@ export let DefaultActionsForContextMenu = (function () {
|
||||
const name = file.name;
|
||||
|
||||
// Consider other cases
|
||||
const image = a.createImageFITS(
|
||||
const image = A.image(
|
||||
url,
|
||||
{name},
|
||||
(ra, dec, fov, _) => {
|
||||
// Center the view around the new fits object
|
||||
a.gotoRaDec(ra, dec);
|
||||
a.setFoV(fov * 1.1);
|
||||
}
|
||||
{
|
||||
name,
|
||||
successCallback: (ra, dec, fov, _) => {
|
||||
// Center the view around the new fits object
|
||||
a.gotoRaDec(ra, dec);
|
||||
a.setFoV(fov * 1.1);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
a.setOverlayImageLayer(image, name)
|
||||
|
||||
@@ -309,12 +309,15 @@ export let GraphicOverlay = (function() {
|
||||
*
|
||||
* @memberof GraphicOverlay
|
||||
*
|
||||
* @param {string} hex - The color given in hexadecimal e.g. '#ffa0bb'
|
||||
* @param {string} color - Any CSS color string (hex e.g. '#ffa0bb', rgb(), named color)
|
||||
* @param {number} percent - The percentage to increase the brightness of
|
||||
*
|
||||
* @returns {string} The new color given as an hexadecimal string
|
||||
*/
|
||||
GraphicOverlay.increaseBrightness = function(hex, percent){
|
||||
GraphicOverlay.increaseBrightness = function(color, percent){
|
||||
// Normalize the color to hex.
|
||||
var hex = Color.standardizeColor(color);
|
||||
|
||||
// strip the leading # if it's there
|
||||
hex = hex.replace(/^\s*#|\s*$/g, '');
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ export let ProgressiveCat = (function() {
|
||||
|
||||
|
||||
// allows for filtering of sources
|
||||
this.filterFn = options.filter || undefined; // TODO: do the same for catalog
|
||||
this.filterFn = options.filter || undefined; // TODO: do the same for catalog
|
||||
|
||||
|
||||
this.onClick = options.onClick || undefined; // TODO: inherit from catalog
|
||||
|
||||
@@ -1893,6 +1893,15 @@ export let View = (function () {
|
||||
|
||||
// Remove the settled promise
|
||||
this.promises.splice(idx, 1);
|
||||
|
||||
const noMoreLayersToWaitFor = this.promises.length === 0;
|
||||
if (noMoreLayersToWaitFor && self.empty) {
|
||||
// no promises to launch and the view has no HiPS.
|
||||
// This situation can occurs if the MOCServer is out
|
||||
// If so we can directly put the url of the DSS hosted in alasky,
|
||||
// it the best I can do if the MOCServer is out
|
||||
self.aladin.setBaseImageLayer(Aladin.DEFAULT_OPTIONS.survey);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -2003,7 +2012,10 @@ export let View = (function () {
|
||||
let imageLayerQueried = this.imageLayersBeingQueried.get(layer);
|
||||
let imageLayer = this.imageLayers.get(layer);
|
||||
|
||||
return imageLayer || imageLayerQueried;
|
||||
let obj = imageLayer || imageLayerQueried;
|
||||
|
||||
if (obj && obj.added)
|
||||
return obj;
|
||||
};
|
||||
|
||||
View.prototype.requestRedraw = function () {
|
||||
|
||||
@@ -1090,7 +1090,7 @@ export class OverlayStackBox extends Box {
|
||||
monochrome: true,
|
||||
},
|
||||
tooltip: {
|
||||
content: "Swap 2 layers",
|
||||
content: "Click on this button for both layers you want to swap",
|
||||
position: { direction: "top" },
|
||||
},
|
||||
toggled: false,
|
||||
|
||||
@@ -87,7 +87,7 @@ export class HiPSSelector extends Input {
|
||||
};
|
||||
|
||||
(function () {
|
||||
ALEvent.FAVORITE_HIPS_LIST_UPDATED.listenedBy(document.body, (event) => {
|
||||
ALEvent.FAVORITE_HIPS_LIST_UPDATED.listenedBy(document, (event) => {
|
||||
let favoritesHips = event.detail;
|
||||
|
||||
HiPSSelector.cachedHiPS = {};
|
||||
|
||||
@@ -203,10 +203,6 @@ export class Layout extends DOMElement {
|
||||
this._show();
|
||||
}
|
||||
|
||||
/**
|
||||
* Empty the layout
|
||||
* @param {content: String|DOMElement, swappable: Boolean, disabled: Boolean, selected: Boolean} item - Represents the structure of the Tabs
|
||||
*/
|
||||
empty() {
|
||||
// remove all the sub elements
|
||||
this.layout = [];
|
||||
|
||||
@@ -203,7 +203,7 @@ function dragElement(triggerElt, elmnt, onDragged) {
|
||||
document.onmouseup = null;
|
||||
document.onmousemove = null;
|
||||
|
||||
var r = elmnt.getBoundingClientRect();
|
||||
/*var r = elmnt.getBoundingClientRect();
|
||||
|
||||
if (t < r.height / 2) {
|
||||
elmnt.style.top = r.height / 2 + "px";
|
||||
@@ -221,7 +221,7 @@ function dragElement(triggerElt, elmnt, onDragged) {
|
||||
|
||||
if (t + r.height / 2 > aladinDiv.offsetHeight) {
|
||||
elmnt.style.top = (aladinDiv.offsetHeight - r.height / 2) + "px";
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user