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

Function encode

resources/vega-embed.min.js:1837–1868  ·  view source on GitHub ↗
(e, t)

Source from the content-addressed store, hash-verified

1835 };
1836 },
1837 encode(e, t) {
1838 const { marktype: n, channels: r } = t,
1839 i = e.functions,
1840 o = "group" === n || "image" === n || "rect" === n;
1841 return (e, t) => {
1842 const a = e.datum;
1843 let s,
1844 l = 0;
1845 for (const n in r)
1846 ((s = Me(r[n].ast, i, t, a, void 0, e)),
1847 e[n] !== s && ((e[n] = s), (l = 1)));
1848 return (
1849 "rule" !== n &&
1850 (function (e, t, n) {
1851 let r;
1852 (t.x2 &&
1853 (t.x
1854 ? (n && e.x > e.x2 && ((r = e.x), (e.x = e.x2), (e.x2 = r)),
1855 (e.width = e.x2 - e.x))
1856 : (e.x = e.x2 - (e.width || 0))),
1857 t.xc && (e.x = e.xc - (e.width || 0) / 2),
1858 t.y2 &&
1859 (t.y
1860 ? (n && e.y > e.y2 && ((r = e.y), (e.y = e.y2), (e.y2 = r)),
1861 (e.height = e.y2 - e.y))
1862 : (e.y = e.y2 - (e.height || 0))),
1863 t.yc && (e.y = e.yc - (e.height || 0) / 2));
1864 })(e, r, o),
1865 l
1866 );
1867 };
1868 },
1869 };
1870 function je(e) {
1871 const [t, n] = /schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1, 3);

Callers

nothing calls this directly

Calls 1

MeFunction · 0.70

Tested by

no test coverage detected