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

Function ma

resources/vega-lite.min.js:2295–2354  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

2293 return f(e, ["legend", "axis", "header", "scale"]);
2294 }
2295 function ma(e) {
2296 let t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {},
2297 n = e.field;
2298 const i = t.prefix;
2299 let r = t.suffix,
2300 o = "";
2301 if (
2302 (function (e) {
2303 return "count" === e.aggregate;
2304 })(e)
2305 )
2306 n = B("count");
2307 else {
2308 let i;
2309 if (!t.nofn)
2310 if (
2311 (function (e) {
2312 return J(e, "op");
2313 })(e)
2314 )
2315 i = e.op;
2316 else {
2317 const { bin: a, aggregate: s, timeUnit: l } = e;
2318 mn(a)
2319 ? ((i = dn(a)), (r = (t.binSuffix ?? "") + (t.suffix ?? "")))
2320 : s
2321 ? an(s)
2322 ? ((o = `["${n}"]`), (n = `argmax_${s.argmax}`))
2323 : on(s)
2324 ? ((o = `["${n}"]`), (n = `argmin_${s.argmin}`))
2325 : (i = String(s))
2326 : l &&
2327 !Ti(l) &&
2328 ((i = (function (e) {
2329 const { utc: t, ...n } = Ii(e);
2330 return n.unit
2331 ? (t ? "utc" : "") +
2332 D(n)
2333 .map((e) =>
2334 C(`${"unit" === e ? "" : `_${e}_`}${n[e]}`),
2335 )
2336 .join("")
2337 : (t ? "utc" : "") +
2338 "timeunit" +
2339 D(n)
2340 .map((e) => C(`_${e}_${n[e]}`))
2341 .join("");
2342 })(l)),
2343 (r =
2344 ((!["range", "mid"].includes(t.binSuffix) && t.binSuffix) ||
2345 "") + (t.suffix ?? "")));
2346 }
2347 i && (n = n ? `${i}_${n}` : i);
2348 }
2349 return (
2350 r && (n = `${n}_${r}`),
2351 i && (n = `${i}_${n}`),
2352 t.forAs ? L(n) : t.expr ? T(n, t.expr) + o : M(n) + o

Callers 15

qnFunction · 0.70
nrFunction · 0.70
yoFunction · 0.70
xoFunction · 0.70
$oFunction · 0.70
OoFunction · 0.70
zoFunction · 0.70
CoFunction · 0.70
GaFunction · 0.70
JaFunction · 0.70
ulFunction · 0.70
makeFromEncodingMethod · 0.70

Calls 14

dnFunction · 0.85
DFunction · 0.85
BFunction · 0.70
JFunction · 0.70
mnFunction · 0.70
anFunction · 0.70
onFunction · 0.70
TiFunction · 0.70
IiFunction · 0.70
CFunction · 0.70
LFunction · 0.70
TFunction · 0.70

Tested by

no test coverage detected