Closed abought closed 5 years ago
FileSaver.js should work. It's ~3KB minified, or ~1.5KB if I remove support for downloading URLs.
I'm happy to implement this change. Do you think that adding FileSaver as a dependency is a good approach? Or adding a copy of FileSaver with the non-Blob functionality removed?
I'm happy to implement this change. Do you think that adding FileSaver as a dependency is a good approach? Or adding a copy of FileSaver with the non-Blob functionality removed?
That seemed an interesting library! I'll try to look at it tonight/tomorrow and follow up. (I'm also kind of curious about StreamSaver, because there are some clever tricks for larger files and wheeeee)
In general, I think my order of thoughts would be as follows:
The proposed no-library fix seems to work for me in limited local testing, but my browser was acting a bit differently than @pjvandehaar 's. Care to give it a try before I close this ticket?
The fix is on the develop
branch, so remember to run npx gulp build
first.
Tested in Chrome, FF, and Safari on localhost.
Thanks for the testing, Peter! I've incorporated your suggestion, and also added a Promise
polyfill for the IE users you uncovered. Changes are now available on the develop
branch. Feel free to reopen if you find any issues.
Reported by @pjvandehaar
Summary
The LocusZoom "download as image" button does not work for extremely large region sizes.
Steps to reproduce
An example page where this occurs is: http://pheweb.sph.umich.edu/SAIGE-UKB/region/008/4:160747832-161147832
(zoom out several times, eg to a region size of 1.2 Mb)
Initial workup
The problem seems to be that links are specified as a
data:
url, and the link is too long. Other options- notably the Blob interface- may yield better results. This behavior seems to be browser dependent as an implementation detail. https://stackoverflow.com/questions/695151/data-protocol-url-size-limitations