* Returns an SVG text string for the rendered content, * or null if this renderer is currently headless.
()
| 124140 | * Returns an SVG text string for the rendered content, |
| 124141 | * or null if this renderer is currently headless. |
| 124142 | */ svg () { |
| 124143 | const svg = this._svg, bg = this._bgcolor; |
| 124144 | if (!svg) return null; |
| 124145 | let node; |
| 124146 | if (bg) { |
| 124147 | svg.removeAttribute("style"); |
| 124148 | node = domChild(svg, RootIndex, "rect", svgns); |
| 124149 | setAttributes(node, { |
| 124150 | width: this._width, |
| 124151 | height: this._height, |
| 124152 | fill: bg |
| 124153 | }); |
| 124154 | } |
| 124155 | const text9 = serializeXML(svg); |
| 124156 | if (bg) { |
| 124157 | svg.removeChild(node); |
| 124158 | this._svg.style.setProperty("background-color", bg); |
| 124159 | } |
| 124160 | return text9; |
| 124161 | }, |
| 124162 | /** |
| 124163 | * Internal rendering method. |
| 124164 | * @param {object} scene - The root mark of a scenegraph to render. |
nothing calls this directly
no test coverage detected