Write a figure to an HTML file representation Parameters ---------- file: str or writeable A string representing a local file path or a writeable object (e.g. a pathlib.Path object or an open file descriptor) config: dict or None (def
(self, *args, **kwargs)
| 3606 | return pio.to_html(self, *args, **kwargs) |
| 3607 | |
| 3608 | def write_html(self, *args, **kwargs): |
| 3609 | """ |
| 3610 | Write a figure to an HTML file representation |
| 3611 | |
| 3612 | Parameters |
| 3613 | ---------- |
| 3614 | file: str or writeable |
| 3615 | A string representing a local file path or a writeable object |
| 3616 | (e.g. a pathlib.Path object or an open file descriptor) |
| 3617 | config: dict or None (default None) |
| 3618 | Plotly.js figure config options |
| 3619 | auto_play: bool (default=True) |
| 3620 | Whether to automatically start the animation sequence on page load |
| 3621 | if the figure contains frames. Has no effect if the figure does not |
| 3622 | contain frames. |
| 3623 | include_plotlyjs: bool or string (default True) |
| 3624 | Specifies how the plotly.js library is included/loaded in the output |
| 3625 | div string. |
| 3626 | |
| 3627 | If True, a script tag containing the plotly.js source code (~3MB) |
| 3628 | is included in the output. HTML files generated with this option are |
| 3629 | fully self-contained and can be used offline. |
| 3630 | |
| 3631 | If 'cdn', a script tag that references the plotly.js CDN is included |
| 3632 | in the output. HTML files generated with this option are about 3MB |
| 3633 | smaller than those generated with include_plotlyjs=True, but they |
| 3634 | require an active internet connection in order to load the plotly.js |
| 3635 | library. |
| 3636 | |
| 3637 | If 'directory', a script tag is included that references an external |
| 3638 | plotly.min.js bundle that is assumed to reside in the same |
| 3639 | directory as the HTML file. If `file` is a string to a local file |
| 3640 | path and `full_html` is True, then the plotly.min.js bundle is copied |
| 3641 | into the directory of the resulting HTML file. If a file named |
| 3642 | plotly.min.js already exists in the output directory then this file |
| 3643 | is left unmodified and no copy is performed. HTML files generated |
| 3644 | with this option can be used offline, but they require a copy of |
| 3645 | the plotly.min.js bundle in the same directory. This option is |
| 3646 | useful when many figures will be saved as HTML files in the same |
| 3647 | directory because the plotly.js source code will be included only |
| 3648 | once per output directory, rather than once per output file. |
| 3649 | |
| 3650 | If a string that ends in '.js', a script tag is included that |
| 3651 | references the specified path. This approach can be used to point |
| 3652 | the resulting HTML file to an alternative CDN or local bundle. |
| 3653 | |
| 3654 | If False, no script tag referencing plotly.js is included. This is |
| 3655 | useful when the resulting div string will be placed inside an HTML |
| 3656 | document that already loads plotly.js. This option is not advised |
| 3657 | when full_html=True as it will result in a non-functional html file. |
| 3658 | |
| 3659 | include_mathjax: bool or string (default False) |
| 3660 | Specifies how the MathJax.js library is included in the output html |
| 3661 | div string. MathJax is required in order to display labels |
| 3662 | with LaTeX typesetting. |
| 3663 | |
| 3664 | If False, no script tag referencing MathJax.js will be included in the |
| 3665 | output. |
no outgoing calls