glue-viz / glue-ar

BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Support multiple layer types in tool UI, fix colormap bug #9

Closed Carifio24 closed 9 months ago

Carifio24 commented 9 months ago

This PR refactors the export dialog UI so that we can easily support multiple layer types within a dialog for the same viewer. The immediate use case is for scatter layers in the volume viewer, which is something that's supported in glue. With this new setup, we now support that functionality. The approach here is to use a registry to associate export layer option states with certain layer state types, then automatically generate a simple UI for these states.

Additionally, this PR fixes a small bug with the colormap export, where pyvista would complain if cmap_vmin > cmap_vmax. Since matplotlib provides reversed colormaps, we can just enforce the order of clim and use the reversed colormap name if necessary.