glue-viz / glue

Linked Data Visualizations Across Multiple Files
http://glueviz.org
Other
721 stars 152 forks source link

Make stretches be customizable on a layer by layer basis #2453

Closed astrofrog closed 7 months ago

astrofrog commented 8 months ago

For the image and scatter viewers, this adds a new dictionary property stretch_parameters which can be used to set stretch parameters specific to the layer. These parameters are then set as attribute on state instances. So the requirement for new stretch classes is that parameters can be set as attributes on existing instances (e.g. LogStretch.exp). Example:

Screenshot from 2023-10-26 15-25-44

Glue deals with keeping stretch_parameters in sync with the stretch instance/object, and will deal with refreshing the plot.

pllim commented 7 months ago

Is this patch not backward compatible?

astrofrog commented 7 months ago

I did try and make it backward compatible but may have missed something. I will investigate the jdaviz failures tomorrow.

pllim commented 7 months ago

I think it is ok. I ended up doing a version check and it seems to work. See https://github.com/spacetelescope/jdaviz/pull/2591