Skip to content

Commit 30d0deb

Browse files
committed
Update interactive-html-export.md
1 parent e285e63 commit 30d0deb

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

doc/python/interactive-html-export.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ jupyter:
66
extension: .md
77
format_name: markdown
88
format_version: '1.3'
9-
jupytext_version: 1.14.1
9+
jupytext_version: 1.14.6
1010
kernelspec:
11-
display_name: Python 3
11+
display_name: Python 3 (ipykernel)
1212
language: python
1313
name: python3
1414
language_info:
@@ -20,7 +20,7 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.8.8
23+
version: 3.10.11
2424
plotly:
2525
description: Plotly allows you to save interactive HTML versions of your figures
2626
to your local disk.
@@ -51,6 +51,7 @@ fig.write_html("path/to/file.html")
5151
```
5252
<!-- #endregion -->
5353

54+
<!-- #region -->
5455
### Controlling the size of the HTML file
5556

5657
By default, the resulting HTML file is a fully self-contained HTML file which can be uploaded to a web server or shared via email or other file-sharing mechanisms. The downside to this approach is that the file is very large (5Mb+) because it contains an inlined copy of the Plotly.js library required to make the figure interactive. This can be controlled via the `include_plotlyjs` argument (see below).
@@ -72,7 +73,7 @@ You can insert Plotly output and text related to your data into HTML templates u
7273

7374
Then use the following Python to replace `{{ fig }}` in the template with HTML that will display the Plotly figure "fig":
7475

75-
```
76+
```python
7677
import plotly.express as px
7778
from jinja2 import Template
7879

@@ -90,7 +91,7 @@ with open(output_html_path, "w", encoding="utf-8") as output_file:
9091
j2_template = Template(template_file.read())
9192
output_file.write(j2_template.render(plotly_jinja_data))
9293
```
93-
94+
<!-- #endregion -->
9495

9596
### HTML export in Dash
9697

0 commit comments

Comments
 (0)