|
|
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).vega={})}(this,(function(t){"use strict";function e(t,e,n){return t.fields=e||[],t.fname=n,t}function n(t){return null==t?null:t.fname}function r(t){return null==t?null:t.fields}function i(t){throw Error(t)}function a(t){var e,n,r,a=[],u=null,o=0,s=t.length,l="";function c(){a.push(l+t.substring(e,n)),l="",e=n+1}for(t+="",e=n=0;n<s;++n)if("\\"===(r=t[n]))l+=t.substring(e,n),l+=t.substring(++n,++n),e=n;else if(r===u)c(),u=null,o=-1;else{if(u)continue;e===o&&'"'===r||e===o&&"'"===r?(e=n+1,u=r):"."!==r||o?"["===r?(n>e&&c(),o=e=n+1):"]"===r&&(o||i("Access path missing open bracket: "+t),o>0&&c(),o=0,e=n+1):n>e?c():e=n+1}return o&&i("Access path missing closing bracket: "+t),u&&i("Access path missing closing quote: "+t),n>e&&(n++,c()),a}var u=Array.isArray;function o(t){return t===Object(t)}function s(t){return"string"==typeof t}function l(t){return u(t)?"["+t.map(l)+"]":o(t)||s(t)?JSON.stringify(t).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):t}function c(t,n){var r=a(t),i="return _["+r.map(l).join("][")+"];";return e(Function("_",i),[t=1===r.length?r[0]:t],n||t)}var f=[],h=c("id"),d=e((function(t){return t}),f,"identity"),p=e((function(){return 0}),f,"zero"),g=e((function(){return 1}),f,"one"),m=e((function(){return!0}),f,"true"),v=e((function(){return!1}),f,"false");function y(t,e,n){var r=[e].concat([].slice.call(n));console[t].apply(console,r)}function _(t,e){var n=t||0;return{level:function(t){return arguments.length?(n=+t,this):n},error:function(){return n>=1&&y(e||"error","ERROR",arguments),this},warn:function(){return n>=2&&y(e||"warn","WARN",arguments),this},info:function(){return n>=3&&y(e||"log","INFO",arguments),this},debug:function(){return n>=4&&y(e||"log","DEBUG",arguments),this}}}const x=t=>"__proto__"!==t;function b(...t){return t.reduce((t,e)=>{for(var n in e)if("signals"===n)t.signals=A(t.signals,e.signals);else{var r="legend"===n?{layout:1}:"style"===n||null;w(t,n,e[n],r)}return t},{})}function w(t,e,n,r){var i,a;if(x(e))if(o(n)&&!u(n))for(i in a=o(t[e])?t[e]:t[e]={},n)r&&(!0===r||r[i])?w(a,i,n[i]):x(i)&&(a[i]=n[i]);else t[e]=n}function A(t,e){if(null==t)return e;const n={},r=[];function i(t){n[t.name]||(n[t.name]=1,r.push(t))}return e.forEach(i),t.forEach(i),r}function k(t){return t[t.length-1]}function M(t){return null==t||""===t?null:+t}function E(t){return function(e){return t*Math.exp(e)}}function D(t){return function(e){return Math.log(t*e)}}function C(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function F(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function S(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function B(t,e,n,r){var i=n(t[0]),a=n(k(t)),u=(a-i)*e;return[r(i-u),r(a-u)]}function z(t,e){return B(t,e,M,d)}function T(t,e){var n=Math.sign(t[0]);return B(t,e,D(n),E(n))}function N(t,e,n){return B(t,e,S(n),S(1/n))}function O(t,e,n){return B(t,e,C(n),F(n))}function R(t,e,n,r,i){var a=r(t[0]),u=r(k(t)),o=null!=e?r(e):(a+u)/2;return[i(o+(a-o)*n),i(o+(u-o)*n)]}function q(t,e,n){return R(t,e,n,M,d)}function U(t,e,n){var r=Math.sign(t[0]);return R(t,e,n,D(r),E(r))}function L(t,e,n,r){return R(t,e,n,S(r),S(1/r))}function P(t,e,n,r){return R(t,e,n,C(r),F(r))}function $(t){return 1+~~(new Date(t).getMonth()/3)}function j(t){return 1+~~(new Date(t).getUTCMonth()/3)}function I(t){return null!=t?u(t)?t:[t]:[]}function H(t,e,n){var r,i=t[0],a=t[1];return a<i&&(r=a,a=i,i=r),(r=a-i)>=n-e?[e,n]:[i=Math.min(Math.max(i,e),n-r),i+r]}function W(t){return"function"==typeof t}function Y(t,n){var i,u,o,s,c,f,h,d,p,g=[],m=(t=I(t)).map((function(t,e){return null==t?null:(g.push(e),W(t)?t:a(t).map(l).join("]["))})),v=g.length-1,y=I(n),_="var u,v;return ";if(v<0)return null;for(u=0;u<=v;++u)W(o=m[i=g[u]])?(s="(u=this."+(f="f"+i)+"(a))",c="(v=this."+f+"(b))",(h=h||{})[f]=o):(s="(u=a["+o+"])",c="(v=b["+o+"])"),f="((v=v instanceof Date?+v:v),(u=u instanceof Date?+u:u))","descending"!==y[i]?(p=1,d=
|