This PR follows the same mold as the previous refactoring PRs, with the image viewer being the viewer of interest this time. The idea is to move the functionality of constructing the exported traces, layout configurations, etc. out to context-independent functions so that we can use them in other export contexts (e.g. the web exporter, glupyter?) in the future, while the export tool handles any Qt-viewer-specific stuff.
The image viewer is easily the most complicated one to export, and does some stuff with secondary axes, so adding this to the web exporter may be nontrivial and can wait for a future PR.
This PR follows the same mold as the previous refactoring PRs, with the image viewer being the viewer of interest this time. The idea is to move the functionality of constructing the exported traces, layout configurations, etc. out to context-independent functions so that we can use them in other export contexts (e.g. the web exporter, glupyter?) in the future, while the export tool handles any Qt-viewer-specific stuff.
The image viewer is easily the most complicated one to export, and does some stuff with secondary axes, so adding this to the web exporter may be nontrivial and can wait for a future PR.