Closed jfoster17 closed 1 year ago
Here are what the basic interactions look like: https://user-images.githubusercontent.com/3639698/223265425-c45a4d0e-74bf-4fba-a94e-a2fc914c3f87.mov
@jfoster17 this is very nice! It looks like this will need rebasing due to conflicts. Would you like me to review this yet at this point or are there things you still need to work on before a first review?
There are still a few more things I need to fix/add before this is ready for review. I will try to keep it to the smallest amount required to be useful though, so that it doesn't get too large.
I wanted to highlight 79e4fa57ec44c50977c4056d9ba3fbc2c9a3322b, because it opens (or increases?) the potential for malicious session files and deserves some consideration. If I'm going to represent regions as Shapely objects we need something like this to enable save/restore of sessions that bundle the data. This also solves #2330.
I'd rather not use allow_pickle if at all possible - is there any way we can serialize/deserialize the Shapely objects to strings?
As noted in https://github.com/glue-viz/glue/issues/2430, I will be splitting out Qt-related code into a separate repository - however that repository will have the same history as the present one here so it should be easy to split the Qt-specific parts of this PR into a separate PR to glue-qt. Sorry for the disruption!
Closing in favor of #2442
Pull Request Template
Description
Here is one approach to displaying many regions (e.g. regions-as-data) in glue (ala #2351). I've implemented this for the first place I wanted it, which is as a different kind of ScatterLayer in the ImageViewer.
The pieces are basically:
ExtendedComponent(Component)
which is a list of Shapely geometriesRegionData(Data)
which is probably unnecessary (moreData
types are hard to support) but for now is used to determine if aData
object should be plotted as regions or as points.ScatterRegionLayerState
andScatterRegionLayerArtist
classes to deal with actually configuring and plotting regionsMajor unfinished things
It's much less clear what the best behavior is when adding RegionData to a scatterplot. The assumption is that if you have regions, you want to plot regions on an image (perhaps color-coded by another component). If you have a table of data about regions you might want to make a scatterplot that just shows those regions (i.e. you don't have an image and just want to see the geometry) or you might want to make a scatterplot 2 components of those regions.