plotly.py icon indicating copy to clipboard operation
plotly.py copied to clipboard

add optionial gzip compression in html export

Open mickare opened this issue 4 years ago • 2 comments

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 the codegen files 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).

mickare avatar Mar 18 '21 16:03 mickare

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 :)

nicolaskruchten avatar Mar 19 '21 14:03 nicolaskruchten

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.

nicolaskruchten avatar May 06 '21 15:05 nicolaskruchten

Closing long-time open PRs...

mickare avatar Aug 16 '24 21:08 mickare