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

Function ga

resources/vega-lite.min.js:2368–2398  ·  view source on GitHub ↗
(e, t)

Source from the content-addressed store, hash-verified

2366 throw new Error(oi(e.type));
2367 }
2368 const ga = (e, t) => {
2369 switch (t.fieldTitle) {
2370 case "plain":
2371 return e.field;
2372 case "functional":
2373 return (function (e) {
2374 const { aggregate: t, bin: n, timeUnit: i, field: r } = e;
2375 if (an(t)) return `${r} for argmax(${t.argmax})`;
2376 if (on(t)) return `${r} for argmin(${t.argmin})`;
2377 const o = i && !Ti(i) ? Ii(i) : void 0,
2378 a = t || o?.unit || (o?.maxbins && "timeunit") || (mn(n) && "bin");
2379 return a ? `${a.toUpperCase()}(${r})` : r;
2380 })(e);
2381 default:
2382 return (function (e, t) {
2383 const { field: n, bin: i, timeUnit: r, aggregate: o } = e;
2384 if ("count" === o) return t.countTitle;
2385 if (mn(i)) return `${n} (binned)`;
2386 if (r && !Ti(r)) {
2387 const e = Ii(r)?.unit;
2388 if (e) return `${n} (${Ri(e).join("-")})`;
2389 } else if (o)
2390 return an(o)
2391 ? `${n} for max ${o.argmax}`
2392 : on(o)
2393 ? `${n} for min ${o.argmin}`
2394 : `${N(o)} of ${n}`;
2395 return n;
2396 })(e, t);
2397 }
2398 };
2399 let ha = ga;
2400 function ya(e) {
2401 ha = e;

Callers

nothing calls this directly

Calls 7

anFunction · 0.70
onFunction · 0.70
TiFunction · 0.70
IiFunction · 0.70
mnFunction · 0.70
RiFunction · 0.70
NFunction · 0.70

Tested by

no test coverage detected