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

Function style

docs/app/js/sanddance-app.js:124296–124309  ·  view source on GitHub ↗

* Update the presentation attributes of an SVG element for a mark item. * @param {SVGElement} el - The SVG element. * @param {Item} item - The mark item.

(el, item)

Source from the content-addressed store, hash-verified

124294 * @param {SVGElement} el - The SVG element.
124295 * @param {Item} item - The mark item.
124296 */ style (el, item) {
124297 if (item == null) return;
124298 for(const prop in styles){
124299 let value9 = prop === "font" ? fontFamily(item) : item[prop];
124300 if (value9 === values[prop]) continue;
124301 const name = styles[prop];
124302 if (value9 == null) el.removeAttribute(name);
124303 else {
124304 if (isGradient(value9)) value9 = gradientRef(value9, this._defs.gradient, href());
124305 el.setAttribute(name, value9 + "");
124306 }
124307 values[prop] = value9;
124308 }
124309 },
124310 /**
124311 * Render SVG defs, as needed.
124312 * Must be called *after* marks have been processed to ensure the

Callers 1

attrFunction · 0.70

Calls 5

fontFamilyFunction · 0.70
isGradientFunction · 0.70
gradientRefFunction · 0.70
hrefFunction · 0.70
fontSizeFunction · 0.70

Tested by

no test coverage detected