Download the canvas content as an image file. Creates a temporary download link and triggers it.
(self, filename="snapped.png")
| 1187 | """ |
| 1188 | |
| 1189 | def download(self, filename="snapped.png"): |
| 1190 | """ |
| 1191 | Download the canvas content as an image file. |
| 1192 | |
| 1193 | Creates a temporary download link and triggers it. |
| 1194 | """ |
| 1195 | # The `a` element class is dynamically created below. |
| 1196 | download_link = a( # noqa: F821 |
| 1197 | download=filename, href=self._dom_element.toDataURL() |
| 1198 | ) |
| 1199 | self.append(download_link) |
| 1200 | download_link._dom_element.click() |
| 1201 | |
| 1202 | def draw(self, what, width=None, height=None): |
| 1203 | """ |
no test coverage detected