From baeed5d2f63cf5a710bbeed1e06031703f859649 Mon Sep 17 00:00:00 2001 From: Xen0Xys Date: Thu, 18 Jul 2024 10:40:40 +0200 Subject: [PATCH] :arrow_up: Bump Aladin Lite to 3.4.5-beta --- CHANGELOG.md | 6 +++++- README.md | 9 +++++---- js/aladin_lite.js | 2 +- js/models/event_handler.js | 16 ++++++++-------- js/widget.js | 6 +++--- 5 files changed, 22 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5028afbb..5989cd58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - monochromatic FITS images can be added to the view with `ipyaladin.Aladin.add_fits`. The method accepts `astropy.io.fits.HDUList`, `pathlib.Path`, or `string` representing paths (#86) +### Changed + +- Upgrade Aladin Lite version to 3.4.5-beta (#96) + ## [0.4.0] ### Added @@ -41,7 +45,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Change the jslink target trait from `target` to `shared_target` (#80) - Change the jslink fov trait from `fov` to `shared_fov` (#83) -- Upgrade Aladin Lite version to 3.4.1-beta (#88) +- Upgrade Aladin Lite version to 3.4.4-beta (#88) - Add support for list of strings in `add_overlay_from_stcs` (#88) ### Deprecated diff --git a/README.md b/README.md index 61e4388e..bdf8388b 100644 --- a/README.md +++ b/README.md @@ -56,10 +56,11 @@ Ipyaladin brings [Aladin Lite](https://github.com/cds-astro/aladin-lite) into no Correspondence table between ipyaladin versions and Aladin Lite versions: -| ipyaladin | Aladin-Lite | -| --------- | ----------- | -| 0.4.0 | 3.4.4-beta | -| 0.3.0 | 3.3.3-dev | +| ipyaladin | Aladin-Lite | +| ---------- | ----------- | +| Unreleased | 3.4.5-beta | +| 0.4.0 | 3.4.4-beta | +| 0.3.0 | 3.3.3-dev | > [!TIP] > This can always be read like so diff --git a/js/aladin_lite.js b/js/aladin_lite.js index 379517f1..98addcb1 100644 --- a/js/aladin_lite.js +++ b/js/aladin_lite.js @@ -1,3 +1,3 @@ -import A from "https://esm.sh/aladin-lite@3.4.4-beta"; +import A from "https://esm.sh/aladin-lite@3.4.5-beta"; export default A; diff --git a/js/models/event_handler.js b/js/models/event_handler.js index 5b3c80cd..49417d04 100644 --- a/js/models/event_handler.js +++ b/js/models/event_handler.js @@ -71,10 +71,10 @@ export default class EventHandler { // fov MUST be cast into float in order to be sent to the model this.model.set("_wcs", this.aladin.getViewWCS()); this.model.set("_fov", parseFloat(fov.toFixed(5))); - const fov_xy = this.aladin.getFov(); + const twoAxisFoV = this.aladin.getFov(); this.model.set("_fov_xy", { - x: fov_xy[0], - y: fov_xy[1], + x: twoAxisFoV[0], + y: twoAxisFoV[1], }); this.model.save_changes(); }); @@ -107,18 +107,18 @@ export default class EventHandler { this.model.save_changes(); }); - this.aladin.on("layerChanged", (_, layer) => { - if (layer !== "base") return; + this.aladin.on("layerChanged", (_, layerName, state) => { + if (layerName !== "base" || state !== "ADDED") return; this.model.set("_wcs", this.aladin.getViewWCS()); this.model.save_changes(); }); this.aladin.on("resizeChanged", () => { this.model.set("_wcs", this.aladin.getViewWCS()); - const fov_xy = this.aladin.getFov(); + const twoAxisFoV = this.aladin.getFov(); this.model.set("_fov_xy", { - x: fov_xy[0], - y: fov_xy[1], + x: twoAxisFoV[0], + y: twoAxisFoV[1], }); this.model.save_changes(); }); diff --git a/js/widget.js b/js/widget.js index 98b05251..3be29317 100644 --- a/js/widget.js +++ b/js/widget.js @@ -25,10 +25,10 @@ function initAladinLite(model, el) { aladin.gotoRaDec(raDec[0], raDec[1]); // Set current FoV and WCS - const FoV = aladin.getFov(); + const twoAxisFoV = aladin.getFov(); model.set("_fov_xy", { - x: FoV[0], - y: FoV[1], + x: twoAxisFoV[0], + y: twoAxisFoV[1], }); model.set("_wcs", aladin.getViewWCS()); model.save_changes();