-
Notifications
You must be signed in to change notification settings - Fork 3
Download Button #596
Description
Since the usefulness of a download button came up at recent meetings, I decided to put together a branch (https://github.com/legumeinfo/web-components/tree/download-button) to use as the basis of a discussion of requirements/needs.
This branch currently has 3 different approaches based on the context:
- The existing download ability in the Pangene Lookup element that downloads a TSV from a dedicated API endpoint on the server
- The addition of a download button to Simon's recent work with Allele Search that downloads a TSV of tabular data already fetched from the ds_utilities endpoint
- A WIP download for the GraphQL-based elements that iterates sequentially through the pages of a user's search results and downloads a TSV
A general solution (e.g. in the case of a dedicated "Download" element to be composed on the page) would need to take into account the different APIs used by the various elements.
Related to this is the GraphQL-specific solution, which isn't ideal. It uses the existing 10 item page size which for queries with high result counts is needlessly slow. However, I was getting inconsistent behavior when both trying to bump the page size (e.g. to 100) and by removing it entirely - in the case of the latter, naive users with big requests could inadvertently knock over the GraphQL server.
I think ideally we have a "dumb" download button that can just be plugged into a dedicated endpoint for downloading requests, similar to how the Pangene Lookup element does it, but would require modifying various services and handling both GraphQL and non-GraphQL requests.