-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Implement add_marker to add a marker to the Aladin Lite view * docs: Add documentation and update changelog * 🐛 Force marker popup text color to black * fix: wrong position of markers due to string parsing in JS --------- Co-authored-by: MARCHAND MANON <[email protected]>
- Loading branch information
1 parent
8123c49
commit d751864
Showing
11 changed files
with
136 additions
and
69 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
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
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
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
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,4 +1,5 @@ | ||
"""Top-level package for ipyaladin.""" | ||
|
||
from .widget import Aladin # noqa: F401 | ||
from .elements.marker import Marker # noqa: F401 | ||
from .__about__ import __version__, __aladin_lite_version__ # noqa: F401 |
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
from dataclasses import dataclass | ||
from typing import Tuple, Union | ||
|
||
from astropy.coordinates import SkyCoord, Longitude, Latitude | ||
from ipyaladin.utils._coordinate_parser import _parse_coordinate_string | ||
|
||
|
||
@dataclass | ||
class Marker: | ||
"""A class representing a marker in Aladin Lite.""" | ||
|
||
def __init__( | ||
self, | ||
position: Union[str, SkyCoord, Tuple[Longitude, Latitude]], | ||
title: str, | ||
description: str, | ||
) -> None: | ||
self.title = title | ||
self.description = description | ||
if isinstance(position, SkyCoord): | ||
self.lon = position.ra.deg | ||
self.lat = position.dec.deg | ||
elif isinstance(position, str): | ||
self.lon, self.lat = _parse_coordinate_string(position) | ||
elif ( | ||
isinstance(position, Tuple) | ||
and isinstance(position[0], Longitude) | ||
and isinstance(position[1], Latitude) | ||
): | ||
self.lon = position[0].deg | ||
self.lat = position[1].deg |
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
Empty file.
File renamed without changes.
File renamed without changes.