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

Function df

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

Source from the content-addressed store, hash-verified

7745 return !1 === n.empty ? `${u} && ${c}` : `!${u} || ${c}`;
7746 }
7747 function df(e, n, i) {
7748 const r = C(n),
7749 o = i.encoding;
7750 let a,
7751 s = i.field;
7752 try {
7753 a = e.getSelectionComponent(r, n);
7754 } catch (e) {
7755 return r;
7756 }
7757 if (o || s) {
7758 if (o && !s) {
7759 const e = a.project.items.filter((e) => e.channel === o);
7760 !e.length || e.length > 1
7761 ? ((s = a.project.items[0].field),
7762 Si(
7763 (function (e, n, i, r) {
7764 return (
7765 (e.length ? "Multiple " : "No ") +
7766 `matching ${t.stringValue(n)} encoding found for selection ${t.stringValue(i.param)}. ` +
7767 `Using "field": ${t.stringValue(r)}.`
7768 );
7769 })(e, o, i, s),
7770 ))
7771 : (s = e[0].field);
7772 }
7773 } else
7774 ((s = a.project.items[0].field),
7775 a.project.items.length > 1 &&
7776 Si(
7777 (function (e) {
7778 return `A "field" or "encoding" must be specified when using a selection as a scale domain. Using "field": ${t.stringValue(e)}.`;
7779 })(s),
7780 ));
7781 return `${a.name}[${t.stringValue(M(s))}]`;
7782 }
7783 function mf(e, n, i) {
7784 return _(n, (n) =>
7785 t.isString(n)

Callers 2

$dFunction · 0.70
xmFunction · 0.70

Calls 4

getSelectionComponentMethod · 0.80
CFunction · 0.70
SiFunction · 0.70
MFunction · 0.70

Tested by

no test coverage detected