astrowidgets icon indicating copy to clipboard operation
astrowidgets copied to clipboard

Add API to deal with astropy regions

Open pllim opened this issue 4 years ago • 2 comments

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 avatar May 20 '21 19:05 pllim

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 avatar Aug 31 '23 19:08 pllim

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

pllim avatar Sep 06 '23 22:09 pllim