(self, tag="svg", **kwargs)
| 89 | } |
| 90 | |
| 91 | def _svg(self, tag="svg", **kwargs): |
| 92 | svg = super()._svg(tag=tag, **kwargs) |
| 93 | svg.set("xmlns", self._SVG_namespace) |
| 94 | if self.background: |
| 95 | svg.append( |
| 96 | ET.Element( |
| 97 | "rect", |
| 98 | fill=self.background, |
| 99 | x="0", |
| 100 | y="0", |
| 101 | width="100%", |
| 102 | height="100%", |
| 103 | ) |
| 104 | ) |
| 105 | return svg |
| 106 | |
| 107 | def _write(self, stream): |
| 108 | ET.ElementTree(self._img).write(stream, encoding="UTF-8", xml_declaration=True) |