astropy / astrowidgets

*PRE-ALPHA*/heavy dev. Jupyter widgets leveraging the Astropy ecosystem
https://astrowidgets.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
31 stars 14 forks source link

Add API to deal with astropy regions #137

Open pllim opened 3 years ago

pllim commented 3 years ago

Similar to what @eteq laid out in spacetelescope/jdaviz#622 . But if he has something more specific than that for astrowidgets, feel free to clarify here. Thanks!

xref #51

pllim commented 1 year ago

https://github.com/astropy/astrowidgets/blob/50258f22d13326c307f252928cc0a691fe139d13/astrowidgets/interface_definition.py#L40

and

https://github.com/astropy/astrowidgets/blob/50258f22d13326c307f252928cc0a691fe139d13/astrowidgets/ginga.py#L131

are analogous to regions.RegionVisual in purpose, but the regions implementation seems to be very specific to Matplotlib. For instance, it has no concept of alpha because Matplotlib embeds that into its color as RGBA (https://stackoverflow.com/questions/15928539/matplotlib-how-to-make-the-marker-face-color-transparent-without-making-the-li).

Therefore, I am not sure if RegionVisual is useful for backend-agnostic implementation.

pllim commented 1 year ago

We can look at an exploratory concrete implementation at https://github.com/spacetelescope/jdaviz/pull/2410 to discuss this further.