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

Function km

resources/vega-lite.min.js:11031–11052  ·  view source on GitHub ↗
(e, n)

Source from the content-addressed store, hash-verified

11029 }
11030 const wm = ["range", "scheme"];
11031 function km(e, n) {
11032 const i = e.fieldDef(n);
11033 if (i?.bin) {
11034 const { bin: r, field: o } = i,
11035 a = st(n),
11036 s = e.getName(a);
11037 if (t.isObject(r) && r.binned && void 0 !== r.step)
11038 return new sm(() => {
11039 const t = e.scaleName(n),
11040 i = `(domain("${t}")[1] - domain("${t}")[0]) / ${r.step}`;
11041 return `${e.getSignalName(s)} / (${i})`;
11042 });
11043 if (mn(r)) {
11044 const t = xd(e, o, r);
11045 return new sm(() => {
11046 const n = e.getSignalName(t),
11047 i = `(${n}.stop - ${n}.start) / ${n}.step`;
11048 return `${e.getSignalName(s)} / (${i})`;
11049 });
11050 }
11051 }
11052 }
11053 function Sm(e, n) {
11054 const i = n.specifiedScales[e],
11055 { size: r } = n,

Callers 1

SmFunction · 0.85

Calls 7

xdFunction · 0.85
getNameMethod · 0.80
scaleNameMethod · 0.80
getSignalNameMethod · 0.80
stFunction · 0.70
mnFunction · 0.70
fieldDefMethod · 0.45

Tested by

no test coverage detected