Comparing version 1.13.0 to 1.13.1
@@ -172,2 +172,4 @@ (function (global, factory) { | ||
const isLegalKey = key => key !== '__proto__'; | ||
function mergeConfig(...configs) { | ||
@@ -186,3 +188,3 @@ return configs.reduce((out, source) => { | ||
// otherwise, no recursion: objects overwrite, no merging | ||
var r = key === 'legend' ? {'layout': 1} | ||
var r = key === 'legend' ? {layout: 1} | ||
: key === 'style' ? true | ||
@@ -198,2 +200,4 @@ : null; | ||
function writeConfig(output, key, value, recurse) { | ||
if (!isLegalKey(key)) return; | ||
var k, o; | ||
@@ -205,3 +209,3 @@ if (isObject(value) && !isArray(value)) { | ||
writeConfig(o, k, value[k]); | ||
} else { | ||
} else if (isLegalKey(k)) { | ||
o[k] = value[k]; | ||
@@ -208,0 +212,0 @@ } |
@@ -1,1 +0,1 @@ | ||
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n=n||self).vega={})}(this,(function(n){"use strict";function t(n,t,r){return n.fields=t||[],n.fname=r,n}function r(n){return null==n?null:n.fields}function e(n){throw Error(n)}function u(n){var t,r,u,o=[],i=null,c=0,f=n.length,l="";function a(){o.push(l+n.substring(t,r)),l="",t=r+1}for(n+="",t=r=0;r<f;++r)if("\\"===(u=n[r]))l+=n.substring(t,r),l+=n.substring(++r,++r),t=r;else if(u===i)a(),i=null,c=-1;else{if(i)continue;t===c&&'"'===u||t===c&&"'"===u?(t=r+1,i=u):"."!==u||c?"["===u?(r>t&&a(),c=t=r+1):"]"===u&&(c||e("Access path missing open bracket: "+n),c>0&&a(),c=0,t=r+1):r>t?a():t=r+1}return c&&e("Access path missing closing bracket: "+n),i&&e("Access path missing closing quote: "+n),r>t&&(r++,a()),o}var o=Array.isArray;function i(n){return n===Object(n)}function c(n){return"string"==typeof n}function f(n){return o(n)?"["+n.map(f)+"]":i(n)||c(n)?JSON.stringify(n).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):n}function l(n,r){var e=u(n),o="return _["+e.map(f).join("][")+"];";return t(Function("_",o),[n=1===e.length?e[0]:n],r||n)}var a=[],s=l("id"),h=t((function(n){return n}),a,"identity"),g=t((function(){return 0}),a,"zero"),p=t((function(){return 1}),a,"one"),v=t((function(){return!0}),a,"true"),m=t((function(){return!1}),a,"false");function y(n,t,r){var e=[t].concat([].slice.call(r));console[n].apply(console,e)}function b(n,t,r,e){var u,c;if(i(r)&&!o(r))for(u in c=i(n[t])?n[t]:n[t]={},r)e&&(!0===e||e[u])?b(c,u,r[u]):c[u]=r[u];else n[t]=r}function d(n,t){if(null==n)return t;const r={},e=[];function u(n){r[n.name]||(r[n.name]=1,e.push(n))}return t.forEach(u),n.forEach(u),e}function M(n){return n[n.length-1]}function j(n){return null==n||""===n?null:+n}function O(n){return function(t){return n*Math.exp(t)}}function w(n){return function(t){return Math.log(n*t)}}function x(n){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/n))}}function z(n){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*n}}function E(n){return function(t){return t<0?-Math.pow(-t,n):Math.pow(t,n)}}function D(n,t,r,e){var u=r(n[0]),o=r(M(n)),i=(o-u)*t;return[e(u-i),e(o-i)]}function k(n,t,r,e,u){var o=e(n[0]),i=e(M(n)),c=null!=t?e(t):(o+i)/2;return[u(c+(o-c)*r),u(c+(i-c)*r)]}function A(n){return null!=n?o(n)?n:[n]:[]}function S(n){return"function"==typeof n}const N=Object.prototype.hasOwnProperty;function R(n,t){return N.call(n,t)}var F={};function P(n){return"[object Date]"===Object.prototype.toString.call(n)}function _(n){return"number"==typeof n}function C(n,t){for(var r="";--t>=0;)r+=n;return r}function L(n){return _(n)||P(n)?n:Date.parse(n)}n.Debug=4,n.Error=1,n.Info=3,n.None=0,n.Warn=2,n.accessor=t,n.accessorFields=r,n.accessorName=function(n){return null==n?null:n.fname},n.array=A,n.clampRange=function(n,t,r){var e,u=n[0],o=n[1];return o<u&&(e=o,o=u,u=e),(e=o-u)>=r-t?[t,r]:[u=Math.min(Math.max(u,t),r-e),u+e]},n.compare=function(n,e){var o,i,c,l,a,s,h,g,p,v=[],m=(n=A(n)).map((function(n,t){return null==n?null:(v.push(t),S(n)?n:u(n).map(f).join("]["))})),y=v.length-1,b=A(e),d="var u,v;return ";if(y<0)return null;for(i=0;i<=y;++i)S(c=m[o=v[i]])?(l="(u=this."+(s="f"+o)+"(a))",a="(v=this."+s+"(b))",(h=h||{})[s]=c):(l="(u=a["+c+"])",a="(v=b["+c+"])"),s="((v=v instanceof Date?+v:v),(u=u instanceof Date?+u:u))","descending"!==b[o]?(p=1,g=-1):(p=-1,g=1),d+="("+l+"<"+a+"||u==null)&&v!=null?"+g+":(u>v||v==null)&&u!=null?"+p+":"+s+"!==u&&v===v?"+g+":v!==v&&u===u?"+p+(o<y?":":":0");return c=Function("a","b",d+";"),h&&(c=c.bind(h)),n=n.reduce((function(n,t){return S(t)?(r(t)||[]).forEach((function(t){n[t]=1})):null!=t&&(n[t+""]=1),n}),{}),t(c,Object.keys(n))},n.constant=function(n){return S(n)?n:function(){return n}},n.debounce=function(n,t){var r,e;function u(){t(e),r=e=null}return function(t){e=t,r&&clearTimeout(r),r=setTimeout(u,n)}},n.error=e,n.extend=function(n){for(var t,r,e=1,u=arguments.length;e<u;++e)for(r in t=arguments[e])n[r]=t[r];return n},n.extent=function(n,t){var r,e,u,o,i=0;if(n&&(r=n.length))if(null==t){for(e=n[i];i<r&&(null==e||e!=e);e=n[++i]);for(u=o=e;i<r;++i)null!=(e=n[i])&&(e<u&&(u=e),e>o&&(o=e))}else{for(e=t(n[i]);i<r&&(null==e||e!=e);e=t(n[++i]));for(u=o=e;i<r;++i)null!=(e=t(n[i]))&&(e<u&&(u=e),e>o&&(o=e))}return[u,o]},n.extentIndex=function(n,t){var r,e,u,o,i,c=-1,f=n.length;if(null==t){for(;++c<f;)if(null!=(e=n[c])&&e>=e){r=u=e;break}if(c===f)return[-1,-1];for(o=i=c;++c<f;)null!=(e=n[c])&&(r>e&&(r=e,o=c),u<e&&(u=e,i=c))}else{for(;++c<f;)if(null!=(e=t(n[c],c,n))&&e>=e){r=u=e;break}if(c===f)return[-1,-1];for(o=i=c;++c<f;)null!=(e=t(n[c],c,n))&&(r>e&&(r=e,o=c),u<e&&(u=e,i=c))}return[o,i]},n.falsy=m,n.fastmap=function(n){var t,r,e={};function u(n){return R(e,n)&&e[n]!==F}return t={size:0,empty:0,object:e,has:u,get:function(n){return u(n)?e[n]:void 0},set:function(n,r){return u(n)||(++t.size,e[n]===F&&--t.empty),e[n]=r,this},delete:function(n){return u(n)&&(--t.size,++t.empty,e[n]=F),this},clear:function(){t.size=t.empty=0,t.object=e={}},test:function(n){return arguments.length?(r=n,t):r},clean:function(){var n,u,o={},i=0;for(n in e)(u=e[n])===F||r&&r(u)||(o[n]=u,++i);t.size=i,t.empty=0,t.object=e=o}},n&&Object.keys(n).forEach((function(r){t.set(r,n[r])})),t},n.field=l,n.flush=function(n,t,r,e,u,o){if(!r&&0!==r)return o;var i,c,f=n[0],l=M(n),a=+r;return l<f&&(i=f,f=l,l=i),(i=Math.abs(t-f))<(c=Math.abs(l-t))&&i<=a?e:c<=a?u:o},n.hasOwnProperty=R,n.id=s,n.identity=h,n.inherits=function(n,t){var r=n.prototype=Object.create(t.prototype);return r.constructor=n,r},n.inrange=function(n,t,r,e){var u,o=t[0],i=t[t.length-1];return o>i&&(u=o,o=i,i=u),e=void 0===e||e,((r=void 0===r||r)?o<=n:o<n)&&(e?n<=i:n<i)},n.isArray=o,n.isBoolean=function(n){return"boolean"==typeof n},n.isDate=P,n.isFunction=S,n.isNumber=_,n.isObject=i,n.isRegExp=function(n){return"[object RegExp]"===Object.prototype.toString.call(n)},n.isString=c,n.key=function(n,r){return n&&(n=r?A(n).map((function(n){return n.replace(/\\(.)/g,"$1")})):A(n)),t(n&&n.length?Function("_","return ''+"+n.map((function(n){return"_["+(r?f(n):u(n).map(f).join("]["))+"]"})).join("+'|'+")+";"):function(){return""},n,"key")},n.lerp=function(n,t){const r=n[0],e=M(n),u=+t;return u?1===u?e:r+u*(e-r):r},n.logger=function(n,t){var r=n||0;return{level:function(n){return arguments.length?(r=+n,this):r},error:function(){return r>=1&&y(t||"error","ERROR",arguments),this},warn:function(){return r>=2&&y(t||"warn","WARN",arguments),this},info:function(){return r>=3&&y(t||"log","INFO",arguments),this},debug:function(){return r>=4&&y(t||"log","DEBUG",arguments),this}}},n.lruCache=function(n){let t,r,e;n=+n||1e4;const u=()=>{t={},r={},e=0},o=(u,o)=>(++e>n&&(r=t,t={},e=1),t[u]=o);return u(),{clear:u,has:n=>R(t,n)||R(r,n),get:n=>R(t,n)?t[n]:R(r,n)?o(n,r[n]):void 0,set:(n,r)=>R(t,n)?t[n]=r:o(n,r)}},n.merge=function(n,t,r,e){var u=t.length,o=r.length;if(!o)return t;if(!u)return r;for(var i=e||new t.constructor(u+o),c=0,f=0,l=0;c<u&&f<o;++l)i[l]=n(t[c],r[f])>0?r[f++]:t[c++];for(;c<u;++c,++l)i[l]=t[c];for(;f<o;++f,++l)i[l]=r[f];return i},n.mergeConfig=function(...n){return n.reduce((n,t)=>{for(var r in t)if("signals"===r)n.signals=d(n.signals,t.signals);else{var e="legend"===r?{layout:1}:"style"===r||null;b(n,r,t[r],e)}return n},{})},n.one=p,n.pad=function(n,t,r,e){var u=r||" ",o=n+"",i=t-o.length;return i<=0?o:"left"===e?C(u,i)+o:"center"===e?C(u,~~(i/2))+o+C(u,Math.ceil(i/2)):o+C(u,i)},n.panLinear=function(n,t){return D(n,t,j,h)},n.panLog=function(n,t){var r=Math.sign(n[0]);return D(n,t,w(r),O(r))},n.panPow=function(n,t,r){return D(n,t,E(r),E(1/r))},n.panSymlog=function(n,t,r){return D(n,t,x(r),z(r))},n.peek=M,n.quarter=function(n){return 1+~~(new Date(n).getMonth()/3)},n.repeat=C,n.span=function(n){return n&&M(n)-n[0]||0},n.splitAccessPath=u,n.stringValue=f,n.toBoolean=function(n){return null==n||""===n?null:!(!n||"false"===n||"0"===n)&&!!n},n.toDate=function(n,t){return t=t||L,null==n||""===n?null:t(n)},n.toNumber=j,n.toSet=function(n){for(var t={},r=0,e=n.length;r<e;++r)t[n[r]]=!0;return t},n.toString=function(n){return null==n||""===n?null:n+""},n.truncate=function(n,t,r,e){var u=null!=e?e:"…",o=n+"",i=o.length,c=Math.max(0,t-u.length);return i<=t?o:"left"===r?u+o.slice(i-c):"center"===r?o.slice(0,Math.ceil(c/2))+u+o.slice(i-~~(c/2)):o.slice(0,c)+u},n.truthy=v,n.utcquarter=function(n){return 1+~~(new Date(n).getUTCMonth()/3)},n.visitArray=function(n,t,r){if(n){var e,u=0,o=n.length;if(t)for(;u<o;++u)(e=t(n[u]))&&r(e,u,n);else n.forEach(r)}},n.writeConfig=b,n.zero=g,n.zoomLinear=function(n,t,r){return k(n,t,r,j,h)},n.zoomLog=function(n,t,r){var e=Math.sign(n[0]);return k(n,t,r,w(e),O(e))},n.zoomPow=function(n,t,r,e){return k(n,t,r,E(e),E(1/e))},n.zoomSymlog=function(n,t,r,e){return k(n,t,r,x(e),z(e))},Object.defineProperty(n,"__esModule",{value:!0})})); | ||
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((n=n||self).vega={})}(this,(function(n){"use strict";function t(n,t,r){return n.fields=t||[],n.fname=r,n}function r(n){return null==n?null:n.fields}function e(n){throw Error(n)}function u(n){var t,r,u,o=[],i=null,c=0,f=n.length,l="";function a(){o.push(l+n.substring(t,r)),l="",t=r+1}for(n+="",t=r=0;r<f;++r)if("\\"===(u=n[r]))l+=n.substring(t,r),l+=n.substring(++r,++r),t=r;else if(u===i)a(),i=null,c=-1;else{if(i)continue;t===c&&'"'===u||t===c&&"'"===u?(t=r+1,i=u):"."!==u||c?"["===u?(r>t&&a(),c=t=r+1):"]"===u&&(c||e("Access path missing open bracket: "+n),c>0&&a(),c=0,t=r+1):r>t?a():t=r+1}return c&&e("Access path missing closing bracket: "+n),i&&e("Access path missing closing quote: "+n),r>t&&(r++,a()),o}var o=Array.isArray;function i(n){return n===Object(n)}function c(n){return"string"==typeof n}function f(n){return o(n)?"["+n.map(f)+"]":i(n)||c(n)?JSON.stringify(n).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):n}function l(n,r){var e=u(n),o="return _["+e.map(f).join("][")+"];";return t(Function("_",o),[n=1===e.length?e[0]:n],r||n)}var a=[],s=l("id"),h=t((function(n){return n}),a,"identity"),g=t((function(){return 0}),a,"zero"),p=t((function(){return 1}),a,"one"),v=t((function(){return!0}),a,"true"),m=t((function(){return!1}),a,"false");function y(n,t,r){var e=[t].concat([].slice.call(r));console[n].apply(console,e)}const b=n=>"__proto__"!==n;function d(n,t,r,e){var u,c;if(b(t))if(i(r)&&!o(r))for(u in c=i(n[t])?n[t]:n[t]={},r)e&&(!0===e||e[u])?d(c,u,r[u]):b(u)&&(c[u]=r[u]);else n[t]=r}function M(n,t){if(null==n)return t;const r={},e=[];function u(n){r[n.name]||(r[n.name]=1,e.push(n))}return t.forEach(u),n.forEach(u),e}function j(n){return n[n.length-1]}function O(n){return null==n||""===n?null:+n}function w(n){return function(t){return n*Math.exp(t)}}function x(n){return function(t){return Math.log(n*t)}}function z(n){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/n))}}function E(n){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*n}}function D(n){return function(t){return t<0?-Math.pow(-t,n):Math.pow(t,n)}}function _(n,t,r,e){var u=r(n[0]),o=r(j(n)),i=(o-u)*t;return[e(u-i),e(o-i)]}function k(n,t,r,e,u){var o=e(n[0]),i=e(j(n)),c=null!=t?e(t):(o+i)/2;return[u(c+(o-c)*r),u(c+(i-c)*r)]}function A(n){return null!=n?o(n)?n:[n]:[]}function S(n){return"function"==typeof n}const N=Object.prototype.hasOwnProperty;function R(n,t){return N.call(n,t)}var F={};function P(n){return"[object Date]"===Object.prototype.toString.call(n)}function C(n){return"number"==typeof n}function L(n,t){for(var r="";--t>=0;)r+=n;return r}function q(n){return C(n)||P(n)?n:Date.parse(n)}n.Debug=4,n.Error=1,n.Info=3,n.None=0,n.Warn=2,n.accessor=t,n.accessorFields=r,n.accessorName=function(n){return null==n?null:n.fname},n.array=A,n.clampRange=function(n,t,r){var e,u=n[0],o=n[1];return o<u&&(e=o,o=u,u=e),(e=o-u)>=r-t?[t,r]:[u=Math.min(Math.max(u,t),r-e),u+e]},n.compare=function(n,e){var o,i,c,l,a,s,h,g,p,v=[],m=(n=A(n)).map((function(n,t){return null==n?null:(v.push(t),S(n)?n:u(n).map(f).join("]["))})),y=v.length-1,b=A(e),d="var u,v;return ";if(y<0)return null;for(i=0;i<=y;++i)S(c=m[o=v[i]])?(l="(u=this."+(s="f"+o)+"(a))",a="(v=this."+s+"(b))",(h=h||{})[s]=c):(l="(u=a["+c+"])",a="(v=b["+c+"])"),s="((v=v instanceof Date?+v:v),(u=u instanceof Date?+u:u))","descending"!==b[o]?(p=1,g=-1):(p=-1,g=1),d+="("+l+"<"+a+"||u==null)&&v!=null?"+g+":(u>v||v==null)&&u!=null?"+p+":"+s+"!==u&&v===v?"+g+":v!==v&&u===u?"+p+(o<y?":":":0");return c=Function("a","b",d+";"),h&&(c=c.bind(h)),n=n.reduce((function(n,t){return S(t)?(r(t)||[]).forEach((function(t){n[t]=1})):null!=t&&(n[t+""]=1),n}),{}),t(c,Object.keys(n))},n.constant=function(n){return S(n)?n:function(){return n}},n.debounce=function(n,t){var r,e;function u(){t(e),r=e=null}return function(t){e=t,r&&clearTimeout(r),r=setTimeout(u,n)}},n.error=e,n.extend=function(n){for(var t,r,e=1,u=arguments.length;e<u;++e)for(r in t=arguments[e])n[r]=t[r];return n},n.extent=function(n,t){var r,e,u,o,i=0;if(n&&(r=n.length))if(null==t){for(e=n[i];i<r&&(null==e||e!=e);e=n[++i]);for(u=o=e;i<r;++i)null!=(e=n[i])&&(e<u&&(u=e),e>o&&(o=e))}else{for(e=t(n[i]);i<r&&(null==e||e!=e);e=t(n[++i]));for(u=o=e;i<r;++i)null!=(e=t(n[i]))&&(e<u&&(u=e),e>o&&(o=e))}return[u,o]},n.extentIndex=function(n,t){var r,e,u,o,i,c=-1,f=n.length;if(null==t){for(;++c<f;)if(null!=(e=n[c])&&e>=e){r=u=e;break}if(c===f)return[-1,-1];for(o=i=c;++c<f;)null!=(e=n[c])&&(r>e&&(r=e,o=c),u<e&&(u=e,i=c))}else{for(;++c<f;)if(null!=(e=t(n[c],c,n))&&e>=e){r=u=e;break}if(c===f)return[-1,-1];for(o=i=c;++c<f;)null!=(e=t(n[c],c,n))&&(r>e&&(r=e,o=c),u<e&&(u=e,i=c))}return[o,i]},n.falsy=m,n.fastmap=function(n){var t,r,e={};function u(n){return R(e,n)&&e[n]!==F}return t={size:0,empty:0,object:e,has:u,get:function(n){return u(n)?e[n]:void 0},set:function(n,r){return u(n)||(++t.size,e[n]===F&&--t.empty),e[n]=r,this},delete:function(n){return u(n)&&(--t.size,++t.empty,e[n]=F),this},clear:function(){t.size=t.empty=0,t.object=e={}},test:function(n){return arguments.length?(r=n,t):r},clean:function(){var n,u,o={},i=0;for(n in e)(u=e[n])===F||r&&r(u)||(o[n]=u,++i);t.size=i,t.empty=0,t.object=e=o}},n&&Object.keys(n).forEach((function(r){t.set(r,n[r])})),t},n.field=l,n.flush=function(n,t,r,e,u,o){if(!r&&0!==r)return o;var i,c,f=n[0],l=j(n),a=+r;return l<f&&(i=f,f=l,l=i),(i=Math.abs(t-f))<(c=Math.abs(l-t))&&i<=a?e:c<=a?u:o},n.hasOwnProperty=R,n.id=s,n.identity=h,n.inherits=function(n,t){var r=n.prototype=Object.create(t.prototype);return r.constructor=n,r},n.inrange=function(n,t,r,e){var u,o=t[0],i=t[t.length-1];return o>i&&(u=o,o=i,i=u),e=void 0===e||e,((r=void 0===r||r)?o<=n:o<n)&&(e?n<=i:n<i)},n.isArray=o,n.isBoolean=function(n){return"boolean"==typeof n},n.isDate=P,n.isFunction=S,n.isNumber=C,n.isObject=i,n.isRegExp=function(n){return"[object RegExp]"===Object.prototype.toString.call(n)},n.isString=c,n.key=function(n,r){return n&&(n=r?A(n).map((function(n){return n.replace(/\\(.)/g,"$1")})):A(n)),t(n&&n.length?Function("_","return ''+"+n.map((function(n){return"_["+(r?f(n):u(n).map(f).join("]["))+"]"})).join("+'|'+")+";"):function(){return""},n,"key")},n.lerp=function(n,t){const r=n[0],e=j(n),u=+t;return u?1===u?e:r+u*(e-r):r},n.logger=function(n,t){var r=n||0;return{level:function(n){return arguments.length?(r=+n,this):r},error:function(){return r>=1&&y(t||"error","ERROR",arguments),this},warn:function(){return r>=2&&y(t||"warn","WARN",arguments),this},info:function(){return r>=3&&y(t||"log","INFO",arguments),this},debug:function(){return r>=4&&y(t||"log","DEBUG",arguments),this}}},n.lruCache=function(n){let t,r,e;n=+n||1e4;const u=()=>{t={},r={},e=0},o=(u,o)=>(++e>n&&(r=t,t={},e=1),t[u]=o);return u(),{clear:u,has:n=>R(t,n)||R(r,n),get:n=>R(t,n)?t[n]:R(r,n)?o(n,r[n]):void 0,set:(n,r)=>R(t,n)?t[n]=r:o(n,r)}},n.merge=function(n,t,r,e){var u=t.length,o=r.length;if(!o)return t;if(!u)return r;for(var i=e||new t.constructor(u+o),c=0,f=0,l=0;c<u&&f<o;++l)i[l]=n(t[c],r[f])>0?r[f++]:t[c++];for(;c<u;++c,++l)i[l]=t[c];for(;f<o;++f,++l)i[l]=r[f];return i},n.mergeConfig=function(...n){return n.reduce((n,t)=>{for(var r in t)if("signals"===r)n.signals=M(n.signals,t.signals);else{var e="legend"===r?{layout:1}:"style"===r||null;d(n,r,t[r],e)}return n},{})},n.one=p,n.pad=function(n,t,r,e){var u=r||" ",o=n+"",i=t-o.length;return i<=0?o:"left"===e?L(u,i)+o:"center"===e?L(u,~~(i/2))+o+L(u,Math.ceil(i/2)):o+L(u,i)},n.panLinear=function(n,t){return _(n,t,O,h)},n.panLog=function(n,t){var r=Math.sign(n[0]);return _(n,t,x(r),w(r))},n.panPow=function(n,t,r){return _(n,t,D(r),D(1/r))},n.panSymlog=function(n,t,r){return _(n,t,z(r),E(r))},n.peek=j,n.quarter=function(n){return 1+~~(new Date(n).getMonth()/3)},n.repeat=L,n.span=function(n){return n&&j(n)-n[0]||0},n.splitAccessPath=u,n.stringValue=f,n.toBoolean=function(n){return null==n||""===n?null:!(!n||"false"===n||"0"===n)&&!!n},n.toDate=function(n,t){return t=t||q,null==n||""===n?null:t(n)},n.toNumber=O,n.toSet=function(n){for(var t={},r=0,e=n.length;r<e;++r)t[n[r]]=!0;return t},n.toString=function(n){return null==n||""===n?null:n+""},n.truncate=function(n,t,r,e){var u=null!=e?e:"…",o=n+"",i=o.length,c=Math.max(0,t-u.length);return i<=t?o:"left"===r?u+o.slice(i-c):"center"===r?o.slice(0,Math.ceil(c/2))+u+o.slice(i-~~(c/2)):o.slice(0,c)+u},n.truthy=v,n.utcquarter=function(n){return 1+~~(new Date(n).getUTCMonth()/3)},n.visitArray=function(n,t,r){if(n){var e,u=0,o=n.length;if(t)for(;u<o;++u)(e=t(n[u]))&&r(e,u,n);else n.forEach(r)}},n.writeConfig=d,n.zero=g,n.zoomLinear=function(n,t,r){return k(n,t,r,O,h)},n.zoomLog=function(n,t,r){var e=Math.sign(n[0]);return k(n,t,r,x(e),w(e))},n.zoomPow=function(n,t,r,e){return k(n,t,r,D(e),D(1/e))},n.zoomSymlog=function(n,t,r,e){return k(n,t,r,z(e),E(e))},Object.defineProperty(n,"__esModule",{value:!0})})); |
{ | ||
"name": "vega-util", | ||
"version": "1.13.0", | ||
"version": "1.13.1", | ||
"description": "JavaScript utilities for Vega.", | ||
@@ -25,3 +25,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "49a57c10b309addc513a52a38e1959ee169d4758" | ||
"gitHead": "2bee653f2a56c2c0d4393d69d172b9ccdb0fe2f9" | ||
} |
import isArray from './isArray'; | ||
import isObject from './isObject'; | ||
const isLegalKey = key => key !== '__proto__'; | ||
export function mergeConfig(...configs) { | ||
@@ -17,3 +19,3 @@ return configs.reduce((out, source) => { | ||
// otherwise, no recursion: objects overwrite, no merging | ||
var r = key === 'legend' ? {'layout': 1} | ||
var r = key === 'legend' ? {layout: 1} | ||
: key === 'style' ? true | ||
@@ -29,2 +31,4 @@ : null; | ||
export function writeConfig(output, key, value, recurse) { | ||
if (!isLegalKey(key)) return; | ||
var k, o; | ||
@@ -36,3 +40,3 @@ if (isObject(value) && !isArray(value)) { | ||
writeConfig(o, k, value[k]); | ||
} else { | ||
} else if (isLegalKey(k)) { | ||
o[k] = value[k]; | ||
@@ -39,0 +43,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
96553
1733