Export the result as HTML, then verify the actual file before sharing it. A notebook view on GitHub may not run custom JavaScript, while a Plotly HTML export can keep hover, zoom, legends, and inline scripts. The trade-off is file size and the risk of embedding more data than the visible chart shows.
Check size before promising an interactive link
Anonymous uploads allow 1 MiB (1,048,576 bytes); Pro allows 10 MiB (10,485,760 bytes). A larger allowance does not enable remote scripts or a Python backend. Check the limits for your actual connection with get_publish_limits; a displayed Pro price does not establish that checkout is available.
Download the static report sample. It is 1418 UTF-8 bytes, contains the synthetic values A=12, B=18 and C=9, and uses a table plus inline SVG. It has no hover or zoom and is not a Plotly export. No customer result or live publication is claimed.
For your own Plotly figure, generate the self-contained file and measure its UTF-8 source before uploading. The following is a recipe to run in your own Plotly environment, not a result measured here:
from pathlib import Path
import plotly.graph_objects as go
fig = go.Figure(go.Bar(x=["A", "B", "C"], y=[12, 18, 9]))
source = fig.to_html(full_html=True, include_plotlyjs=True)
size = len(source.encode("utf-8"))
print({"bytes": size, "within_anonymous_limit": size <= 1_048_576,
"within_pro_limit": size <= 10_485_760})
Path("report.html").write_text(source, encoding="utf-8")
Choosing include_plotlyjs="cdn" reduces the source file but requires an external script, which the HTML viewer blocks. If the self-contained file exceeds your allowance, use a static report or another host; if it fits, still verify the actual shared chart’s hover, zoom and labels.
Choose the right export
| Export | Interactive? | Main trade-off |
|---|---|---|
| PNG or SVG | No | Small and predictable, but no hover or filtering |
| Notebook on GitHub | Limited | GitHub renders notebooks but custom JavaScript may not work |
| Plotly HTML using a CDN | Yes when the library loads | Depends on an external network request |
| Self-contained Plotly HTML | Yes | Plotly says the file can exceed 5 MB |
HTML2WEB’s anonymous flow accepts one file up to 1 MiB; Pro allows up to 10 MiB. Its viewer blocks external network connections, so a CDN-dependent chart is not a reliable fit. A full self-contained Plotly file may exceed the size limit before data is added.
Prepare a shareable artifact
- Restart or clear the notebook output you do not need.
- Remove access tokens, local paths, user names, internal URLs, raw query results, and hidden hover fields.
- Aggregate or replace sensitive rows with public fixture data.
- Export only the final figure or report section.
- Prefer inline code and styles that do not need external requests.
- Check the file size in bytes.
- Open the HTML offline and test the interactions.
- Publish with a short expiry and verify the public link in a private window.
Do not assume that deleting a visible table removes its data. Plotly traces, notebook outputs, script variables, and HTML source can contain values that do not appear until someone inspects the page.
When the file exceeds your allowance
Use one of these honest alternatives:
- publish a static SVG or PNG with a short written interpretation;
- reduce points, precision, repeated labels, or unused traces;
- split a multi-chart report into distinct, task-focused pages;
- host the application in an environment designed for larger artifacts and runtime dependencies.
Do not minify away provenance or remove accessibility text merely to hit a limit. If the chart needs live data, authentication, callbacks, Python execution, or large libraries, it is an application—not a single-file preview.
Verify the recipient experience
At the public URL, test keyboard access, visible labels, hover or zoom, legends, mobile width, expiry, and the absence of network errors. Add a plain-language summary before the chart so the main result is available even when an interaction is inaccessible.
Publish a sanitized file with the HTML-to-URL tool. For reports produced by an agent, also run the secret-check workflow before upload.
