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

Function ms

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

Source from the content-addressed store, hash-verified

3629 };
3630 }
3631 function ms(e, t) {
3632 const { encoding: n } = e;
3633 if (
3634 (function (e) {
3635 return (
3636 (oa(e.x) || oa(e.y)) &&
3637 !oa(e.x2) &&
3638 !oa(e.y2) &&
3639 !oa(e.xError) &&
3640 !oa(e.xError2) &&
3641 !oa(e.yError) &&
3642 !oa(e.yError2)
3643 );
3644 })(n)
3645 )
3646 return { orient: rs(e, t), inputType: "raw" };
3647 const i = (function (e) {
3648 return oa(e.x2) || oa(e.y2);
3649 })(n),
3650 r = (function (e) {
3651 return oa(e.xError) || oa(e.xError2) || oa(e.yError) || oa(e.yError2);
3652 })(n),
3653 o = n.x,
3654 a = n.y;
3655 if (i) {
3656 if (r)
3657 throw new Error(
3658 `${t} cannot be both type aggregated-upper-lower and aggregated-error`,
3659 );
3660 const e = n.x2,
3661 i = n.y2;
3662 if (oa(e) && oa(i)) throw new Error(`${t} cannot have both x2 and y2`);
3663 if (oa(e)) {
3664 if (na(o))
3665 return { orient: "horizontal", inputType: "aggregated-upper-lower" };
3666 throw new Error(`Both x and x2 have to be quantitative in ${t}`);
3667 }
3668 if (oa(i)) {
3669 if (na(a))
3670 return { orient: "vertical", inputType: "aggregated-upper-lower" };
3671 throw new Error(`Both y and y2 have to be quantitative in ${t}`);
3672 }
3673 throw new Error("No ranged axis");
3674 }
3675 {
3676 const e = n.xError,
3677 i = n.xError2,
3678 r = n.yError,
3679 s = n.yError2;
3680 if (oa(i) && !oa(e))
3681 throw new Error(`${t} cannot have xError2 without xError`);
3682 if (oa(s) && !oa(r))
3683 throw new Error(`${t} cannot have yError2 without yError`);
3684 if (oa(e) && oa(r))
3685 throw new Error(
3686 `${t} cannot have both xError and yError with both are quantiative`,
3687 );
3688 if (oa(e)) {

Callers 1

psFunction · 0.70

Calls 3

oaFunction · 0.70
rsFunction · 0.70
naFunction · 0.70

Tested by

no test coverage detected