Maidr.save_html
Maidr.save_html(
file
*
lib_dir='lib'
include_version=True
data_in_svg=True
use_cdn='auto'
hover_mode=None
)Save the HTML representation of the figure with MAIDR to a file.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| file | str | The file to save to. | required |
| lib_dir | str | The directory to save the dependencies to (relative to the file’s directory). | "lib" |
| include_version | bool | Whether to include the version number in the dependency folder name. | True |
| data_in_svg | bool | Controls where the MAIDR JSON payload is placed in the output HTML or SVG. | True |
| use_cdn | bool or {'auto'} | * True: load maidr.js from the CDN only. * False: copy the bundled maidr.js and its assets into lib_dir next to the saved HTML and reference the script with a relative path (no network access required). A DotPad SDK downloaded with :func:maidr.download_dotpad_sdk is copied there too, so a tactile display works offline as well. * "auto" (default): attempt the CDN first and fall back to the bundled copy client-side if the CDN request fails. The bundled files are still copied alongside the HTML so the fallback works offline. |
"auto" |
| hover_mode | ('pointermove', 'click', 'off') | The chart’s starting value for the reader’s Hover Mode setting, written to the schema as hoverMode. None leaves it out, so maidr.js uses its default, "pointermove". See :func:maidr.render. |
"pointermove" |