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

Method makeFromEncoding

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

Source from the content-addressed store, hash-verified

5638 (super(e), (this.timeUnits = t));
5639 }
5640 static makeFromEncoding(e, t) {
5641 const n = t.reduceFieldDef((e, n, i) => {
5642 const { field: r, timeUnit: o } = n;
5643 if (o) {
5644 let a;
5645 if (Ti(o)) {
5646 if (qm(t)) {
5647 const { mark: e, markDef: i, config: s } = t,
5648 l = Ho({ fieldDef: n, markDef: i, config: s });
5649 (eo(e) || l) && (a = { timeUnit: Ii(o), field: r });
5650 }
5651 } else a = { as: ma(n, { forAs: !0 }), field: r, timeUnit: o };
5652 if (qm(t)) {
5653 const { mark: e, markDef: r, config: o } = t,
5654 s = Ho({ fieldDef: n, markDef: r, config: o });
5655 eo(e) && _t(i) && 0.5 !== s && (a.rectBandPosition = s);
5656 }
5657 a && (e[d(a)] = a);
5658 }
5659 return e;
5660 }, {});
5661 return S(n) ? null : new Dc(e, n);
5662 }
5663 static makeFromTransform(e, t) {
5664 const { timeUnit: n, ...i } = { ...t },
5665 r = { ...i, timeUnit: Ii(n) };

Callers 1

hpFunction · 0.45

Calls 10

reduceFieldDefMethod · 0.80
TiFunction · 0.70
qmFunction · 0.70
HoFunction · 0.70
eoFunction · 0.70
IiFunction · 0.70
maFunction · 0.70
_tFunction · 0.70
dFunction · 0.70
SFunction · 0.70

Tested by

no test coverage detected