-
Notifications
You must be signed in to change notification settings - Fork 27
Description
Is your feature request related to a problem? Please describe.
When exporting large graphs using Sigma.write_html(), the resulting HTML file can become significantly large. This is primarily because the graph data (nodes and edges) is embedded as a raw, uncompressed JSON string within the HTML file. For complex networks with many attributes, this file size can make sharing or hosting the visualization difficult.
Describe the solution you'd like
I would like to request a new parameter for Sigma.write_html() (e.g., compression=True or json_compression='gzip') that compresses the underlying graph data before embedding it.
Proposed workflow:
- Python side: The graph JSON is generated, GZIP compressed, and potentially Base64 encoded.
- HTML Template: The template includes a small decompression library (like
pakoor using the DecompressionStream API if browser support allows) to inflate the data on the client side before passing it to Sigma.js.
Describe alternatives you've considered
- Manually zipping the HTML file: This works for transport but requires the recipient to unzip the file before viewing it.
- Hosting data externally: Loading a separate
.json.gzfile works but sacrifices the convenience of a single, self-contained HTML file thatwrite_htmlprovides.
Additional context
Adding this feature would significantly reduce the file size of exported visualizations, keeping them portable and easier to share via email or static hosting, especially for graphs with thousands of nodes/edges.