The optional browser files that come with draw: a small script that makes drawings
written with to_svg(interactive=True) hoverable, selectable and (with data-draw-zoom)
zoomable, and a starting stylesheet for it. Serve them as static files; neither needs inline
code, so both work under a strict Content-Security-Policy.
interactive_script() -> str
The JavaScript (no dependencies) for interactive drawings.
Source code in src/ictdesigntools/draw/assets.py
| def interactive_script() -> str:
"""The JavaScript (no dependencies) for interactive drawings."""
return files(__package__).joinpath("static/interactive.js").read_text(encoding="utf-8")
|
A starting stylesheet for the classes the script sets.
Source code in src/ictdesigntools/draw/assets.py
| def interactive_css() -> str:
"""A starting stylesheet for the classes the script sets."""
return files(__package__).joinpath("static/interactive.css").read_text(encoding="utf-8")
|