Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vega-util

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vega-util - npm Package Compare versions

Comparing version 1.5.0 to 1.6.0

src/transform.js

84

build/vega-util.js

@@ -171,2 +171,72 @@ (function (global, factory) {

var peek = function(array) {
return array[array.length - 1];
};
var toNumber = function(_) {
return _ == null || _ === '' ? null : +_;
};
function exp(sign) {
return function(x) { return sign * Math.exp(x); };
}
function log$1(sign) {
return function(x) { return Math.log(sign * x); };
}
function pow(exponent) {
return function(x) {
return x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);
};
}
function pan(domain, delta, lift, ground) {
var d0 = lift(domain[0]),
d1 = lift(peek(domain)),
dd = (d1 - d0) * delta;
return [
ground(d0 - dd),
ground(d1 - dd)
];
}
function panLinear(domain, delta) {
return pan(domain, delta, toNumber, identity);
}
function panLog(domain, delta) {
var sign = Math.sign(domain[0]);
return pan(domain, delta, log$1(sign), exp(sign));
}
function panPow(domain, delta, exponent) {
return pan(domain, delta, pow(exponent), pow(1/exponent));
}
function zoom(domain, anchor, scale, lift, ground) {
var d0 = lift(domain[0]),
d1 = lift(peek(domain)),
da = anchor != null ? lift(anchor) : (d0 + d1) / 2;
return [
ground(da + (d0 - da) * scale),
ground(da + (d1 - da) * scale)
];
}
function zoomLinear(domain, anchor, scale) {
return zoom(domain, anchor, scale, toNumber, identity);
}
function zoomLog(domain, anchor, scale) {
var sign = Math.sign(domain[0]);
return zoom(domain, anchor, scale, log$1(sign), exp(sign));
}
function zoomPow(domain, anchor, scale, exponent) {
return zoom(domain, anchor, scale, pow(exponent), pow(1/exponent));
}
var array = function(_) {

@@ -473,6 +543,2 @@ return _ != null ? (isArray(_) ? _ : [_]) : [];

var peek = function(array) {
return array[array.length - 1];
};
var toBoolean = function(_) {

@@ -491,6 +557,2 @@ return _ == null || _ === '' ? null : !_ || _ === 'false' || _ === '0' ? false : !!_;

var toNumber = function(_) {
return _ == null || _ === '' ? null : +_;
};
var toString = function(_) {

@@ -545,2 +607,8 @@ return _ == null || _ === '' ? null : _ + '';

exports.Debug = Debug;
exports.panLinear = panLinear;
exports.panLog = panLog;
exports.panPow = panPow;
exports.zoomLinear = zoomLinear;
exports.zoomLog = zoomLog;
exports.zoomPow = zoomPow;
exports.array = array;

@@ -547,0 +615,0 @@ exports.compare = compare;

2

build/vega-util.min.js

@@ -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.vega=n.vega||{})}(this,function(n){"use strict";function t(n){return null==n?null:n.fields}function e(n){return f(n)?"["+n.map(e)+"]":l(n)||a(n)?JSON.stringify(n).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):n}function r(n,t,e){var r=[t].concat([].slice.call(e));console[n].apply(console,r)}function u(n){return x(n)?n:k(n)?n:Date.parse(n)}var o=function(n,t,e){return n.fields=t||[],n.fname=e,n},i=function(n){throw Error(n)},c=function(n){function t(){o.push(a+n.substring(e,r)),a="",e=r+1}var e,r,u,o=[],c=null,f=0,l=n.length,a="";for(n+="",e=r=0;r<l;++r)if("\\"===(u=n[r]))a+=n.substring(e,r),e=++r;else if(u===c)t(),c=null,f=-1;else{if(c)continue;e===f&&'"'===u?(e=r+1,c=u):e===f&&"'"===u?(e=r+1,c=u):"."!==u||f?"["===u?(r>e&&t(),f=e=r+1):"]"===u&&(f||i("Access path missing open bracket: "+n),f>0&&t(),f=0,e=r+1):r>e?t():e=r+1}return f&&i("Access path missing closing bracket: "+n),c&&i("Access path missing closing quote: "+n),r>e&&(r++,t()),o},f=Array.isArray,l=function(n){return n===Object(n)},a=function(n){return"string"==typeof n},s=function(n,t){var r=c(n),u="return _["+r.map(e).join("][")+"];";return o(Function("_",u),[n=1===r.length?r[0]:n],t||n)},p=[],g=s("id"),h=o(function(n){return n},p,"identity"),v=o(function(){return 0},p,"zero"),y=o(function(){return 1},p,"one"),b=o(function(){return!0},p,"true"),d=o(function(){return!1},p,"false"),m=function(n){return null!=n?f(n)?n:[n]:[]},j=function(n){return"function"==typeof n},O={},k=function(n){return"[object Date]"===Object.prototype.toString.call(n)},x=function(n){return"number"==typeof n},A=function(n,t){for(var e="";--t>=0;)e+=n;return e};n.accessor=o,n.accessorName=function(n){return null==n?null:n.fname},n.accessorFields=t,n.id=g,n.identity=h,n.zero=v,n.one=y,n.truthy=b,n.falsy=d,n.logger=function(n){var t=n||0;return{level:function(n){return arguments.length?(t=+n,this):t},error:function(){return t>=1&&r("error","ERROR",arguments),this},warn:function(){return t>=2&&r("warn","WARN",arguments),this},info:function(){return t>=3&&r("log","INFO",arguments),this},debug:function(){return t>=4&&r("log","DEBUG",arguments),this}}},n.None=0,n.Error=1,n.Warn=2,n.Info=3,n.Debug=4,n.array=m,n.compare=function(n,r){var u,i,f,l,a,s,p,g,h,v=[],y=(n=m(n)).map(function(n,t){return null==n?null:(v.push(t),j(n)?n:c(n).map(e).join("]["))}),b=v.length-1,d=m(r),O="var u,v;return ";if(b<0)return null;for(i=0;i<=b;++i)f=y[u=v[i]],j(f)?(l="(u=this."+(s="f"+u)+"(a))",a="(v=this."+s+"(b))",(p=p||{})[s]=f):(l="(u=a["+f+"])",a="(v=b["+f+"])"),s="((v=v instanceof Date?+v:v),(u=u instanceof Date?+u:u))","descending"!==d[u]?(h=1,g=-1):(h=-1,g=1),O+="("+l+"<"+a+"||u==null)&&v!=null?"+g+":(u>v||v==null)&&u!=null?"+h+":"+s+"!==u&&v===v?"+g+":v!==v&&u===u?"+h+(u<b?":":":0");return f=Function("a","b",O+";"),p&&(f=f.bind(p)),n=n.reduce(function(n,e){return j(e)?(t(e)||[]).forEach(function(t){n[t]=1}):null!=e&&(n[e+""]=1),n},{}),o(f,Object.keys(n))},n.constant=function(n){return j(n)?n:function(){return n}},n.debounce=function(n,t){function e(){t(u),r=u=null}var r,u;return function(t){u=t,r&&clearTimeout(r),r=setTimeout(e,n)}},n.error=i,n.extend=function(n){for(var t,e,r=1,u=arguments.length;r<u;++r){t=arguments[r];for(e in t)n[e]=t[e]}return n},n.extentIndex=function(n,t){var e,r,u,o,i,c=-1,f=n.length;if(null==t){for(;++c<f;)if(null!=(r=n[c])&&r>=r){e=u=r;break}for(o=i=c;++c<f;)null!=(r=n[c])&&(e>r&&(e=r,o=c),u<r&&(u=r,i=c))}else{for(;++c<f;)if(null!=(r=t(n[c],c,n))&&r>=r){e=u=r;break}for(o=i=c;++c<f;)null!=(r=t(n[c],c,n))&&(e>r&&(e=r,o=c),u<r&&(u=r,i=c))}return[o,i]},n.fastmap=function(n){function t(n){return u.hasOwnProperty(n)&&u[n]!==O}var e,r,u={};return e={size:0,empty:0,object:u,has:t,get:function(n){return t(n)?u[n]:void 0},set:function(n,r){return t(n)||(++e.size,u[n]===O&&--e.empty),u[n]=r,this},delete:function(n){return t(n)&&(--e.size,++e.empty,u[n]=O),this},clear:function(){e.size=e.empty=0,e.object=u={}},test:function(n){return arguments.length?(r=n,e):r},clean:function(){var n,t,o={},i=0;for(n in u)(t=u[n])===O||r&&r(t)||(o[n]=t,++i);e.size=i,e.empty=0,e.object=u=o}},n&&Object.keys(n).forEach(function(t){e.set(t,n[t])}),e},n.field=s,n.inherits=function(n,t){var e=n.prototype=Object.create(t.prototype);return e.constructor=n,e},n.isArray=f,n.isBoolean=function(n){return"boolean"==typeof n},n.isDate=k,n.isFunction=j,n.isNumber=x,n.isObject=l,n.isRegExp=function(n){return"[object RegExp]"===Object.prototype.toString.call(n)},n.isString=a,n.key=function(n){var t=(n=n?m(n):n)&&n.length?Function("_","return ''+"+n.map(function(n){return"_["+c(n).map(e).join("][")+"]"}).join("+'|'+")+";"):function(){return""};return o(t,n,"key")},n.merge=function(n,t,e,r){var u=t.length,o=e.length;if(!o)return t;if(!u)return e;for(var i=r||new t.constructor(u+o),c=0,f=0,l=0;c<u&&f<o;++l)i[l]=n(t[c],e[f])>0?e[f++]:t[c++];for(;c<u;++c,++l)i[l]=t[c];for(;f<o;++f,++l)i[l]=e[f];return i},n.pad=function(n,t,e,r){var u=e||" ",o=n+"",i=t-o.length;return i<=0?o:"left"===r?A(u,i)+o:"center"===r?A(u,~~(i/2))+o+A(u,Math.ceil(i/2)):o+A(u,i)},n.peek=function(n){return n[n.length-1]},n.repeat=A,n.splitAccessPath=c,n.stringValue=e,n.toBoolean=function(n){return null==n||""===n?null:!(!n||"false"===n||"0"===n||!n)},n.toDate=function(n,t){return t=t||u,null==n||""===n?null:t(n)},n.toNumber=function(n){return null==n||""===n?null:+n},n.toString=function(n){return null==n||""===n?null:n+""},n.toSet=function(n){for(var t={},e=0,r=n.length;e<r;++e)t[n[e]]=1;return t},n.truncate=function(n,t,e,r){var u=null!=r?r:"…",o=n+"",i=o.length,c=Math.max(0,t-u.length);return i<=t?o:"left"===e?u+o.slice(i-c):"center"===e?o.slice(0,Math.ceil(c/2))+u+o.slice(i-~~(c/2)):o.slice(0,c)+u},n.visitArray=function(n,t,e){if(n){var r,u=0,o=n.length;if(t)for(;u<o;++u)(r=t(n[u]))&&e(r,u,n);else n.forEach(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.vega=n.vega||{})}(this,function(n){"use strict";function t(n){return null==n?null:n.fields}function r(n){return h(n)?"["+n.map(r)+"]":g(n)||v(n)?JSON.stringify(n).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):n}function e(n,t,r){var e=[t].concat([].slice.call(r));console[n].apply(console,e)}function u(n){return function(t){return n*Math.exp(t)}}function o(n){return function(t){return Math.log(n*t)}}function i(n){return function(t){return t<0?-Math.pow(-t,n):Math.pow(t,n)}}function c(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 f(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 l(n){return N(n)?n:D(n)?n:Date.parse(n)}var a=function(n,t,r){return n.fields=t||[],n.fname=r,n},s=function(n){throw Error(n)},p=function(n){function t(){o.push(l+n.substring(r,e)),l="",r=e+1}var r,e,u,o=[],i=null,c=0,f=n.length,l="";for(n+="",r=e=0;e<f;++e)if("\\"===(u=n[e]))l+=n.substring(r,e),r=++e;else if(u===i)t(),i=null,c=-1;else{if(i)continue;r===c&&'"'===u?(r=e+1,i=u):r===c&&"'"===u?(r=e+1,i=u):"."!==u||c?"["===u?(e>r&&t(),c=r=e+1):"]"===u&&(c||s("Access path missing open bracket: "+n),c>0&&t(),c=0,r=e+1):e>r?t():r=e+1}return c&&s("Access path missing closing bracket: "+n),i&&s("Access path missing closing quote: "+n),e>r&&(e++,t()),o},h=Array.isArray,g=function(n){return n===Object(n)},v=function(n){return"string"==typeof n},y=function(n,t){var e=p(n),u="return _["+e.map(r).join("][")+"];";return a(Function("_",u),[n=1===e.length?e[0]:n],t||n)},b=[],m=y("id"),d=a(function(n){return n},b,"identity"),j=a(function(){return 0},b,"zero"),O=a(function(){return 1},b,"one"),x=a(function(){return!0},b,"true"),z=a(function(){return!1},b,"false"),M=function(n){return n[n.length-1]},k=function(n){return null==n||""===n?null:+n},w=function(n){return null!=n?h(n)?n:[n]:[]},A=function(n){return"function"==typeof n},E={},D=function(n){return"[object Date]"===Object.prototype.toString.call(n)},N=function(n){return"number"==typeof n},F=function(n,t){for(var r="";--t>=0;)r+=n;return r};n.accessor=a,n.accessorName=function(n){return null==n?null:n.fname},n.accessorFields=t,n.id=m,n.identity=d,n.zero=j,n.one=O,n.truthy=x,n.falsy=z,n.logger=function(n){var t=n||0;return{level:function(n){return arguments.length?(t=+n,this):t},error:function(){return t>=1&&e("error","ERROR",arguments),this},warn:function(){return t>=2&&e("warn","WARN",arguments),this},info:function(){return t>=3&&e("log","INFO",arguments),this},debug:function(){return t>=4&&e("log","DEBUG",arguments),this}}},n.None=0,n.Error=1,n.Warn=2,n.Info=3,n.Debug=4,n.panLinear=function(n,t){return c(n,t,k,d)},n.panLog=function(n,t){var r=Math.sign(n[0]);return c(n,t,o(r),u(r))},n.panPow=function(n,t,r){return c(n,t,i(r),i(1/r))},n.zoomLinear=function(n,t,r){return f(n,t,r,k,d)},n.zoomLog=function(n,t,r){var e=Math.sign(n[0]);return f(n,t,r,o(e),u(e))},n.zoomPow=function(n,t,r,e){return f(n,t,r,i(e),i(1/e))},n.array=w,n.compare=function(n,e){var u,o,i,c,f,l,s,h,g,v=[],y=(n=w(n)).map(function(n,t){return null==n?null:(v.push(t),A(n)?n:p(n).map(r).join("]["))}),b=v.length-1,m=w(e),d="var u,v;return ";if(b<0)return null;for(o=0;o<=b;++o)i=y[u=v[o]],A(i)?(c="(u=this."+(l="f"+u)+"(a))",f="(v=this."+l+"(b))",(s=s||{})[l]=i):(c="(u=a["+i+"])",f="(v=b["+i+"])"),l="((v=v instanceof Date?+v:v),(u=u instanceof Date?+u:u))","descending"!==m[u]?(g=1,h=-1):(g=-1,h=1),d+="("+c+"<"+f+"||u==null)&&v!=null?"+h+":(u>v||v==null)&&u!=null?"+g+":"+l+"!==u&&v===v?"+h+":v!==v&&u===u?"+g+(u<b?":":":0");return i=Function("a","b",d+";"),s&&(i=i.bind(s)),n=n.reduce(function(n,r){return A(r)?(t(r)||[]).forEach(function(t){n[t]=1}):null!=r&&(n[r+""]=1),n},{}),a(i,Object.keys(n))},n.constant=function(n){return A(n)?n:function(){return n}},n.debounce=function(n,t){function r(){t(u),e=u=null}var e,u;return function(t){u=t,e&&clearTimeout(e),e=setTimeout(r,n)}},n.error=s,n.extend=function(n){for(var t,r,e=1,u=arguments.length;e<u;++e){t=arguments[e];for(r in t)n[r]=t[r]}return n},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}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}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.fastmap=function(n){function t(n){return u.hasOwnProperty(n)&&u[n]!==E}var r,e,u={};return r={size:0,empty:0,object:u,has:t,get:function(n){return t(n)?u[n]:void 0},set:function(n,e){return t(n)||(++r.size,u[n]===E&&--r.empty),u[n]=e,this},delete:function(n){return t(n)&&(--r.size,++r.empty,u[n]=E),this},clear:function(){r.size=r.empty=0,r.object=u={}},test:function(n){return arguments.length?(e=n,r):e},clean:function(){var n,t,o={},i=0;for(n in u)(t=u[n])===E||e&&e(t)||(o[n]=t,++i);r.size=i,r.empty=0,r.object=u=o}},n&&Object.keys(n).forEach(function(t){r.set(t,n[t])}),r},n.field=y,n.inherits=function(n,t){var r=n.prototype=Object.create(t.prototype);return r.constructor=n,r},n.isArray=h,n.isBoolean=function(n){return"boolean"==typeof n},n.isDate=D,n.isFunction=A,n.isNumber=N,n.isObject=g,n.isRegExp=function(n){return"[object RegExp]"===Object.prototype.toString.call(n)},n.isString=v,n.key=function(n){var t=(n=n?w(n):n)&&n.length?Function("_","return ''+"+n.map(function(n){return"_["+p(n).map(r).join("][")+"]"}).join("+'|'+")+";"):function(){return""};return a(t,n,"key")},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.pad=function(n,t,r,e){var u=r||" ",o=n+"",i=t-o.length;return i<=0?o:"left"===e?F(u,i)+o:"center"===e?F(u,~~(i/2))+o+F(u,Math.ceil(i/2)):o+F(u,i)},n.peek=M,n.repeat=F,n.splitAccessPath=p,n.stringValue=r,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=k,n.toString=function(n){return null==n||""===n?null:n+""},n.toSet=function(n){for(var t={},r=0,e=n.length;r<e;++r)t[n[r]]=1;return t},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.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)}},Object.defineProperty(n,"__esModule",{value:!0})});

@@ -25,2 +25,11 @@ export {

export {
panLinear,
panLog,
panPow,
zoomLinear,
zoomLog,
zoomPow
} from './src/transform';
export {default as array} from './src/array';

@@ -27,0 +36,0 @@ export {default as compare} from './src/compare';

{
"name": "vega-util",
"version": "1.5.0",
"version": "1.6.0",
"description": "JavaScript utilities for Vega.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -337,13 +337,5 @@ # vega-util

<a name="peek" href="#peek">#</a>
vega.<b>peek</b>(<i>array</i>)
[<>](https://github.com/vega/vega-util/blob/master/src/peek.js "Source")
Returns the last element in the input *array*. Similar to the built-in
`Array.pop` method, except that it does not remove the last element. This
method is a convenient shorthand for `array[array.length - 1]`.
<a name="merge" href="#merge">#</a>
vega.<b>merge</b>(<i>compare</i>, <i>array1</i>, <i>array2</i>[, <i>output</i>])
[<>](https://github.com/vega/vega-util/blob/master/src/peek.js "Source")
[<>](https://github.com/vega/vega-util/blob/master/src/merge.js "Source")

@@ -356,2 +348,44 @@ Merge two sorted arrays into a single sorted array. The input *compare*

<a name="panLinear" href="#panLinear">#</a>
vega.<b>panLinear</b>(<i>domain</i>, <i>delta</i>)
[<>](https://github.com/vega/vega-util/blob/master/src/transform.js "Source")
Given an input numeric _domain_ (sorted in increasing order), returns a
new domain array that translates the domain by a _delta_ using a linear
transform. The _delta_ value is expressed as a fraction of the current
domain span, and may be positive or negative to indicate the translation
direction. The return value is a two-element array indicating the starting
and ending value of the translated (panned) domain.
<a name="panLog" href="#panLog">#</a>
vega.<b>panLog</b>(<i>domain</i>, <i>delta</i>)
[<>](https://github.com/vega/vega-util/blob/master/src/transform.js "Source")
Given an input numeric _domain_ (sorted in increasing order), returns a
new domain array that translates the domain by a _delta_ using a logarithmic
transform. The _delta_ value is expressed as a fraction of the current
domain span, and may be positive or negative to indicate the translation
direction. The return value is a two-element array indicating the starting
and ending value of the translated (panned) domain.
<a name="panPow" href="#panPow">#</a>
vega.<b>panPow</b>(<i>domain</i>, <i>delta</i>, <i>exponent</i>)
[<>](https://github.com/vega/vega-util/blob/master/src/transform.js "Source")
Given an input numeric _domain_ (sorted in increasing order), returns a
new domain array that translates the domain by a _delta_ using a power
scale transform parameterized by the provided _exponent_. The _delta_ value
is expressed as a fraction of the current domain span, and may be positive
or negative to indicate the translation direction. The return value is a
two-element array indicating the starting and ending value of the
translated (panned) domain.
<a name="peek" href="#peek">#</a>
vega.<b>peek</b>(<i>array</i>)
[<>](https://github.com/vega/vega-util/blob/master/src/peek.js "Source")
Returns the last element in the input *array*. Similar to the built-in
`Array.pop` method, except that it does not remove the last element. This
method is a convenient shorthand for `array[array.length - 1]`.
<a name="toSet" href="#toSet">#</a>

@@ -393,3 +427,35 @@ vega.<b>toSet</b>(<i>array</i>)

<a name="zoomLinear" href="#zoomLinear">#</a>
vega.<b>zoomLinear</b>(<i>domain</i>, <i>anchor</i>, <i>scale</i>)
[<>](https://github.com/vega/vega-util/blob/master/src/transform.js "Source")
Given an input numeric _domain_ (sorted in increasing order), returns a
new domain array that scales (zooms) the domain by a _scale_ factor using
a linear transform, centered on the given _anchor_ value. If _anchor_ is
`null`, the midpoint of the domain is used instead. The return value is a
two-element array indicating the starting and ending value of the
scaled (zoomed) domain.
<a name="zoomLog" href="#zoomLog">#</a>
vega.<b>zoomLog</b>(<i>domain</i>, <i>anchor</i>, <i>scale</i>)
[<>](https://github.com/vega/vega-util/blob/master/src/transform.js "Source")
Given an input numeric _domain_ (sorted in increasing order), returns a
new domain array that scales (zooms) the domain by a _scale_ factor using
a logarithmic transform, centered on the given _anchor_ value. If _anchor_
is `null`, the midpoint of the domain is used instead. The return value is
a two-element array indicating the starting and ending value of the
scaled (zoomed) domain.
<a name="zoomPow" href="#zoomPow">#</a>
vega.<b>zoomPow</b>(<i>domain</i>, <i>anchor</i>, <i>scale</i>, <i>exponent</i>)
[<>](https://github.com/vega/vega-util/blob/master/src/transform.js "Source")
Given an input numeric _domain_ (sorted in increasing order), returns a
new domain array that scales (zooms) the domain by a _scale_ factor using
a power scale transform parameterized by the provided _exponent_, centered
on the given _anchor_ value. If _anchor_ is `null`, the midpoint of the
domain is used instead. The return value is a two-element array indicating
the starting and ending value of the scaled (zoomed) domain.
### Strings

@@ -396,0 +462,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc