MCPcopy Index your code
hub / github.com/microsoft/SandDance / svg

Function svg

docs/app/js/sanddance-app.js:124142–124161  ·  view source on GitHub ↗

* Returns an SVG text string for the rendered content, * or null if this renderer is currently headless.

()

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 3

domChildFunction · 0.70
setAttributesFunction · 0.70
serializeXMLFunction · 0.70

Tested by

no test coverage detected