add optionial gzip compression in html export
Exporting big 3d meshes resulted in huge files since the data is stored as plain text in the html file. By storing the data in compressed base64 the file size can be reduced by 85%.
Reduction Examples: 96.8mb to 15.4mb 42.2mb to 2.7mb 27.6mb to 6.8mb
Code PR
- [x] I have read through the contributing notes and understand the structure of the package. In particular, if my PR modifies code of
plotly.graph_objects, my modifications concern thecodegenfiles and not generated files. - [ ] I have added tests (if submitting a new feature or correcting a bug) or modified existing tests.
- [ ] For a new feature, I have added documentation examples in an existing or new tutorial notebook (please see the doc checklist as well).
- [x] I have added a CHANGELOG entry if fixing/changing/adding anything substantial.
- [x] For a new feature or a change in behaviour, I have updated the relevant docstrings in the code to describe the feature or behaviour (please see the doc checklist as well).
Thanks for this pull request! We will try to review it in the coming month for inclusion in the upcoming v5.0 of this library :)
Sorry for the delay in reviewing this... I'm a bit hesitant to accept this PR because it adds a dependency on another Javascript library which tends to add maintenance work as security vulnerabilities are found etc etc. We're looking at ways to encode large numerical arrays as base64-encoded binary data soon, which should go a long way towards reducing file sizes in cases like the above, without needing to ungzip in the browser like this.
Closing long-time open PRs...