Compare commits

...

5 Commits

Author SHA1 Message Date
Matthieu Baumann
3476c535e6 v3.8.2 2026-03-06 16:48:31 +01:00
Matthieu Baumann
af3f844bcc fix incl of aladin lite script in head 2026-03-06 16:41:38 +01:00
Tom Donaldson
6dc1722cd2 Update change log. 2026-03-05 16:14:05 +01:00
Tom Donaldson
9a47a6b11d Allow GraphicOverlay.increaseBrightness() to accept named colors 2026-03-05 16:14:05 +01:00
Matthieu Baumann
543fc7ef8e fix doc 2026-03-05 14:57:24 +01:00
20 changed files with 7915 additions and 240 deletions

View File

@@ -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>

View File

@@ -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",

View File

@@ -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>

View File

@@ -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">

View File

@@ -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(() => {

View File

@@ -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",

View File

@@ -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"

View File

@@ -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"

View File

@@ -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

View File

@@ -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;

View File

@@ -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);
}
/**

View File

@@ -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)

View File

@@ -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, '');

View File

@@ -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

View File

@@ -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 () {

View File

@@ -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,

View File

@@ -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 = {};

View File

@@ -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 = [];

View File

@@ -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";
}
}*/
}
}