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

Function SC

resources/vega.min.js:22912–22965  ·  view source on GitHub ↗
(t, e, n, r, i, o)

Source from the content-addressed store, hash-verified

22910 DC.prototype = Object.create(jD.prototype);
22911 var FC = (1 + Math.sqrt(5)) / 2;
22912 function SC(t, e, n, r, i, o) {
22913 for (
22914 var a,
22915 s,
22916 u,
22917 l,
22918 c,
22919 f,
22920 h,
22921 d,
22922 p,
22923 g,
22924 m,
22925 y = [],
22926 v = e.children,
22927 _ = 0,
22928 x = 0,
22929 b = v.length,
22930 w = e.value;
22931 _ < b;
22932
22933 ) {
22934 ((u = i - n), (l = o - r));
22935 do {
22936 c = v[x++].value;
22937 } while (!c && x < b);
22938 for (
22939 f = h = c,
22940 m = c * c * (g = Math.max(l / u, u / l) / (w * t)),
22941 p = Math.max(h / m, m / f);
22942 x < b;
22943 ++x
22944 ) {
22945 if (
22946 ((c += s = v[x].value),
22947 s < f && (f = s),
22948 s > h && (h = s),
22949 (m = c * c * g),
22950 (d = Math.max(h / m, m / f)) > p)
22951 ) {
22952 c -= s;
22953 break;
22954 }
22955 p = d;
22956 }
22957 (y.push((a = { value: c, dice: u < l, children: v.slice(_, x) })),
22958 a.dice
22959 ? dC(a, n, r, i, w ? (r += (l * c) / w) : o)
22960 : CC(a, n, r, w ? (n += (u * c) / w) : i, o),
22961 (w -= c),
22962 (_ = x));
22963 }
22964 return y;
22965 }
22966 var $C = (function t(e) {
22967 function n(t, n, r, i, o) {
22968 SC(e, t, n, r, i, o);

Callers 1

nFunction · 0.85

Calls 2

dCFunction · 0.85
CCFunction · 0.85

Tested by

no test coverage detected