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

Method makeFromEncoding

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

Source from the content-addressed store, hash-verified

9377 return this.dimensions;
9378 }
9379 static makeFromEncoding(e, t) {
9380 let n = !1;
9381 t.forEachFieldDef((e) => {
9382 e.aggregate && (n = !0);
9383 });
9384 const i = {},
9385 r = new Set();
9386 return n
9387 ? (t.forEachFieldDef((e, n) => {
9388 const { aggregate: o, field: a } = e;
9389 if (o)
9390 if ("count" === o)
9391 ((i["*"] ??= {}),
9392 (i["*"].count = new Set([ma(e, { forAs: !0 })])));
9393 else {
9394 if (on(o) || an(o)) {
9395 const e = on(o) ? "argmin" : "argmax",
9396 t = o[e];
9397 ((i[t] ??= {}),
9398 (i[t][e] = new Set([
9399 ma({ op: e, field: t }, { forAs: !0 }),
9400 ])));
9401 } else
9402 ((i[a] ??= {}), (i[a][o] = new Set([ma(e, { forAs: !0 })])));
9403 Qt(n) &&
9404 "unaggregated" === t.scaleDomain(n) &&
9405 ((i[a] ??= {}),
9406 (i[a].min = new Set([
9407 ma({ field: a, aggregate: "min" }, { forAs: !0 }),
9408 ])),
9409 (i[a].max = new Set([
9410 ma({ field: a, aggregate: "max" }, { forAs: !0 }),
9411 ])));
9412 }
9413 else kd(r, n, e, t);
9414 }),
9415 r.size + D(i).length === 0 ? null : new Sd(e, r, i))
9416 : null;
9417 }
9418 static makeFromTransform(e, t) {
9419 const n = new Set(),
9420 i = {};

Callers

nothing calls this directly

Calls 8

kdFunction · 0.85
DFunction · 0.85
forEachFieldDefMethod · 0.80
scaleDomainMethod · 0.80
maFunction · 0.70
onFunction · 0.70
anFunction · 0.70
QtFunction · 0.70

Tested by

no test coverage detected