glue-viz / glue-plotly

Experimental plot.ly plugin for glue
BSD 3-Clause "New" or "Revised" License
2 stars 8 forks source link

Share functionality between web and HTML 2D scatter exporters #29

Closed Carifio24 closed 1 year ago

Carifio24 commented 1 year ago

This PR refactors the code used in the HTML 2D scatter exporter so that it can be used by the corresponding web exporter as well. The goal is to have these common functions contain all of the real export logic, particularly for traces, so that the web exporter and HTML tool only need to handle context-specific stuff. A side effect of this is that the 2D scatter web exporter now has feature parity with the corresponding HTML exporter.

To achieve this, I've created a new common directory. This contains functionality specific to 2D scatter exports (scatter2d.py) as well as some routines that I think will be useful across multiple viewers (common.py). I also fixed a bug that I noticed along the way where points with zero opacity from a matplotlib colormap were not handled correctly.

Future PRs will do the same for the histogram viewer, as well as hopefully expand the web exporter to handle more viewer types.