MCPcopy Create free account
hub / github.com/alignoth/alignoth / attr

Method attr

resources/vega.min.js:15350–15398  ·  view source on GitHub ↗
(t, e, n, r)

Source from the content-addressed store, hash-verified

15348 return null;
15349 }
15350 attr(t, e, n, r) {
15351 const i = {},
15352 o = (t, e, n, r) => {
15353 i[r || t] = e;
15354 };
15355 return (
15356 Array.isArray(n) ? n.forEach((t) => t(o, e, this)) : n(o, e, this),
15357 r &&
15358 (function (t, e, n, r, i) {
15359 let o;
15360 if (null == e) return t;
15361 "bgrect" === r &&
15362 !1 === n.interactive &&
15363 (t["pointer-events"] = "none");
15364 if (
15365 "bgfore" === r &&
15366 (!1 === n.interactive && (t["pointer-events"] = "none"),
15367 (t.display = "none"),
15368 null !== e.fill)
15369 )
15370 return t;
15371 "image" === r &&
15372 !1 === e.smooth &&
15373 (o = [
15374 "image-rendering: optimizeSpeed;",
15375 "image-rendering: pixelated;",
15376 ]);
15377 "text" === r &&
15378 ((t["font-family"] = Oy(e)),
15379 (t["font-size"] = $y(e) + "px"),
15380 (t["font-style"] = e.fontStyle),
15381 (t["font-variant"] = e.fontVariant),
15382 (t["font-weight"] = e.fontWeight));
15383 for (const n in o_) {
15384 let r = e[n];
15385 const o = o_[n];
15386 ("transparent" !== r || ("fill" !== o && "stroke" !== o)) &&
15387 null != r &&
15388 (Xp(r) && (r = Jp(r, i.gradient, "")), (t[o] = r));
15389 }
15390 for (const t in a_) {
15391 const n = e[t];
15392 null != n && ((o = o || []), o.push(`${a_[t]}: ${n};`));
15393 }
15394 o && (t.style = o.join(" "));
15395 })(i, e, t, r, this._defs),
15396 i
15397 );
15398 }
15399 defs(t) {
15400 const e = this._defs.gradient,
15401 n = this._defs.clipping;

Callers 3

oMethod · 0.95
i_Function · 0.80
_updateMethod · 0.80

Calls 6

OyFunction · 0.85
$yFunction · 0.85
XpFunction · 0.85
JpFunction · 0.85
tFunction · 0.70
nFunction · 0.70

Tested by

no test coverage detected