Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds an exporter for the table viewer. This implementation uses Plotly's
Table
trace. The basic approach is simple - we use the table viewer model to get the relevant data and colors, which are used to create the Plotly table's cells.At least to me, there are two main features of the table viewer - manipulating layers, and sorting the table by a column. We can create buttons in Plotly to allow us to change the cells of the exported trace, but the relevant updated cells have to be pre-computed (that is, when we do the export). Thus trying to capture every possible state would create an extremely bloated export. This PR makes the choice to allow sorting, but not hiding/showing different layers, in the exported trace. Since each sort column requires another (sorted) copy of the data, this implementation presents users with a dialog to select which columns, if any, they want sorted. Sorting in the exported trace is done via a dropdown. If the user doesn't select any, the dropdown doesn't appear.
Since there's no legend (as there's only one trace), I've also added colored annotations that display the name of each layer. Also, the Plotly table has one feature that we don't, the ability to drag-and-drop to reorder columns, so that's a plus.