Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add exporter for table viewer #27

Merged
merged 8 commits into from
Mar 23, 2023
Merged

Add exporter for table viewer #27

merged 8 commits into from
Mar 23, 2023

Conversation

Carifio24
Copy link
Member

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.

@Carifio24
Copy link
Member Author

It looks like the CI errors here (and on main) are due to the bug that was fixed in glue-viz/glue#2377.

@Carifio24 Carifio24 merged commit 896e17f into glue-viz:main Mar 23, 2023
@Carifio24 Carifio24 added enhancement New feature or request HTML exporters Qt labels Sep 15, 2023
@Carifio24 Carifio24 changed the title Add export for table viewer Add exporter for table viewer Sep 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant