As Alyssa (and maybe others) have pointed out in glue meetings, the Plotly exporters are currently not great about giving the user any feedback about things that happen. In particular, there are two main issues:
The exporters currently fail silently. Any error messages do go into the error console, but if a user doesn't know to look there, they won't know anything went wrong until they go try to open their exported plot.
There isn't a good indication of when the export is complete - the user just has to wait until they are able to manipulate glue again to know that things are finished, as the export blocks the UI. This is particularly noticeable for the 3D scatter and image exporters, which can often take a nontrivial amount of time to complete.
This PR looks to solve these two issues in the following ways:
Use the messagebox_on_error decorator to let the user know when an error has occurred. This prevents the error message from going into the error console, but the message box shows the entire traceback, so I think this is better than the export failing silently.
For the 3D scatter and image exporters, add a blocking dialog that tells them that the Plotly export is still going. This dialog closes once the export is complete. This way users have a clear way to know when the export has finished. To do this, I split out the code that does the actual Plotly export from the activate function, since we don't want this blocking dialog to run until after the user has finished selecting options (i.e. selecting hover info and choosing a filepath).
Edit: I've added one more feature to this PR, which is to cancel the export if the user selects cancel on either the hover dialog (where applicable) and the filename dialog. Currently, clicking cancel on either of these windows has no effect and the export continues (if the user cancels on the filename dialog, the export is still done and output to a file named .html - easy to miss on Linux/Mac!)
As Alyssa (and maybe others) have pointed out in glue meetings, the Plotly exporters are currently not great about giving the user any feedback about things that happen. In particular, there are two main issues:
This PR looks to solve these two issues in the following ways:
messagebox_on_error
decorator to let the user know when an error has occurred. This prevents the error message from going into the error console, but the message box shows the entire traceback, so I think this is better than the export failing silently.Edit: I've added one more feature to this PR, which is to cancel the export if the user selects cancel on either the hover dialog (where applicable) and the filename dialog. Currently, clicking cancel on either of these windows has no effect and the export continues (if the user cancels on the filename dialog, the export is still done and output to a file named
.html
- easy to miss on Linux/Mac!)