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 "Export" menu to toolbars with CSV/NPY/TIFF exports #885

Merged
merged 4 commits into from
Dec 6, 2021
Merged

Conversation

axelboc
Copy link
Contributor

@axelboc axelboc commented Nov 30, 2021

Fix #35

The feature detection is actually quite simple: I've discovered that an abstract class can have an optional method! So if the provider implements the method, it is defined; otherwise it isn't. This means that the toolbar can just check if getTiffUrl is defined to decide whether to show the export button.

I've provided a tentative implementation of the method for H5Grove. It returns a URL of this form: https://<h5grove.url>/tiff/?<axios-params>&path=/foo&selection=0:,:. Up to H5Grove to then respond at this URL with the TIFF data and the correct Content-type HTTP header (image/tiff).

image


Update

I've merged #890 into this branch, so now it includes CSV and NPY exports as well.

@axelboc axelboc added the waiting Waiting for another task to be completed label Dec 1, 2021
@axelboc
Copy link
Contributor Author

axelboc commented Dec 1, 2021

Marking the PR as "waiting" until you find the time to implement the TIFF endpoint in H5Grove.

@loichuder
Copy link
Member

Marking the PR as "waiting" until you find the time to implement the TIFF endpoint in H5Grove.

The demo is now requesting the tentative implementation at silx-kit/h5grove#54. You can give it a try

@axelboc
Copy link
Contributor Author

axelboc commented Dec 2, 2021

I'm getting a black TIFF file with the right dimensions, so I assume it works!

@axelboc
Copy link
Contributor Author

axelboc commented Dec 2, 2021

We'll just have to update the compatibility comment in h5grove-api once you've merged the PR on H5Grove.

@axelboc axelboc changed the title Add "Export to TIFF" button to Heatmap toolbar Add "Export" menu to toolbars with CSV/NPY/TIFF exports Dec 6, 2021
@axelboc axelboc removed the waiting Waiting for another task to be completed label Dec 6, 2021
@axelboc axelboc merged commit a2d7c6c into main Dec 6, 2021
@axelboc axelboc deleted the tiff branch December 6, 2021 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Copying/exporting datasets
2 participants