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

vega-scale

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vega-scale - npm Package Compare versions

Comparing version 2.4.0 to 2.5.0

8

build/vega-scale.js

@@ -336,2 +336,8 @@ (function (global, factory) {

// Addresses #1395, refine if/when d3-scale tickFormat is exposed
scale.tickFormat = function() {
var linear = $.scaleLinear().domain([domain[0], vegaUtil.peek(domain)]);
return linear.tickFormat.apply(linear, arguments);
};
scale.copy = function() {

@@ -463,3 +469,3 @@ return binOrdinal().domain(scale.domain()).range(scale.range());

var delta = max - min;
return !delta ? vegaUtil.constant(0)
return !delta || !isFinite(delta) ? vegaUtil.constant(0)
: scale.type === 'linear' || scale.type === 'sequential'

@@ -466,0 +472,0 @@ ? function(_$$1) { return (_$$1 - min) / delta; }

2

build/vega-scale.min.js

@@ -1,1 +0,1 @@

!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("d3-array"),require("d3-scale"),require("vega-util"),require("d3-interpolate"),require("d3-scale-chromatic"),require("d3-time")):"function"==typeof define&&define.amd?define(["exports","d3-array","d3-scale","vega-util","d3-interpolate","d3-scale-chromatic","d3-time"],n):n(e.vega={},e.d3,e.d3,e.vega,e.d3,e.d3,e.d3)}(this,function(e,g,m,o,a,r,n){"use strict";function h(e,n,r){var t=e-n+2*r;return e?0<t?t:1:0}function t(){var c,d,r=m.scaleOrdinal().unknown(void 0),l=r.domain,f=r.range,s=[0,1],u=!1,o=0,b=0,p=.5;function n(){var e=l().length,n=s[1]<s[0],r=s[n-0],t=s[1-n],a=h(e,o,b);c=(t-r)/(a||1),u&&(c=Math.floor(c)),r+=(t-r-c*(e-o))*p,d=c*(1-o),u&&(r=Math.round(r),d=Math.round(d));var i=g.range(e).map(function(e){return r+c*e});return f(n?i.reverse():i)}return delete r.unknown,r.domain=function(e){return arguments.length?(l(e),n()):l()},r.range=function(e){return arguments.length?(s=[+e[0],+e[1]],n()):s.slice()},r.rangeRound=function(e){return s=[+e[0],+e[1]],u=!0,n()},r.bandwidth=function(){return d},r.step=function(){return c},r.round=function(e){return arguments.length?(u=!!e,n()):u},r.padding=function(e){return arguments.length?(b=Math.max(0,Math.min(1,e)),o=b,n()):o},r.paddingInner=function(e){return arguments.length?(o=Math.max(0,Math.min(1,e)),n()):o},r.paddingOuter=function(e){return arguments.length?(b=Math.max(0,Math.min(1,e)),n()):b},r.align=function(e){return arguments.length?(p=Math.max(0,Math.min(1,e)),n()):p},r.invertRange=function(e){if(null!=e[0]&&null!=e[1]){var n,r,t,a=+e[0],i=+e[1],c=s[1]<s[0],u=c?f().reverse():f(),o=u.length-1;if(a==a&&i==i&&(i<a&&(t=a,a=i,i=t),!(i<u[0]||a>s[1-c])))return n=Math.max(0,g.bisectRight(u,a)-1),r=a===i?n:g.bisectRight(u,i)-1,a-u[n]>d+1e-10&&++n,c&&(t=n,n=o-r,r=o-t),r<n?void 0:l().slice(n,r+1)}},r.invert=function(e){var n=r.invertRange([e,e]);return n?n[0]:n},r.copy=function(){return t().domain(l()).range(s).round(u).paddingInner(o).paddingOuter(b).align(p)},n()}var i=Array.prototype.map,c=Array.prototype.slice;function u(e){return i.call(e,function(e){return+e})}function d(e,n){return 1<arguments.length?(l[e]=(r=e,t=n,function(){var d,a,e=t();return e.invertRange||(e.invertRange=e.invert?(a=e,function(e){var n,r=e[0],t=e[1];return t<r&&(n=r,r=t,t=n),[a.invert(r),a.invert(t)]}):e.invertExtent?(d=e,function(e){var n,r,t,a,i=d.range(),c=e[0],u=e[1],o=-1;for(u<c&&(r=c,c=u,u=r),t=0,a=i.length;t<a;++t)i[t]>=c&&i[t]<=u&&(o<0&&(o=t),n=t);if(!(o<0))return c=d.invertExtent(i[o]),u=d.invertExtent(i[n]),[void 0===c[0]?c[1]:c[0],void 0===u[1]?u[0]:u[1]]}):void 0),e.type=r,e}),this):l.hasOwnProperty(e)?l[e]:void 0;var r,t}var l={identity:m.scaleIdentity,linear:m.scaleLinear,log:m.scaleLog,ordinal:m.scaleOrdinal,pow:m.scalePow,sqrt:m.scaleSqrt,quantile:m.scaleQuantile,quantize:m.scaleQuantize,threshold:m.scaleThreshold,time:m.scaleTime,utc:m.scaleUtc,band:t,point:function(){return function e(n){var r=n.copy;return n.padding=n.paddingOuter,delete n.paddingInner,n.copy=function(){return e(r())},n}(t().paddingInner(1))},sequential:function e(r){var t=m.scaleLinear(),a=0,i=1,c=!1;function n(){var e=t.domain();a=e[0],i=o.peek(e)-a}function u(e){var n=(e-a)/i;return r(c?Math.max(0,Math.min(1,n)):n)}return u.clamp=function(e){return arguments.length?(c=!!e,u):c},u.domain=function(e){return arguments.length?(t.domain(e),n(),u):t.domain()},u.interpolator=function(e){return arguments.length?(r=e,u):r},u.copy=function(){return e().domain(t.domain()).clamp(c).interpolator(r)},u.ticks=function(e){return t.ticks(e)},u.tickFormat=function(e,n){return t.tickFormat(e,n)},u.nice=function(e){return t.nice(e),n(),u},u},"bin-linear":function e(){var n=m.scaleLinear(),t=[];function a(e){return n(e)}return a.domain=function(e){return arguments.length?(t=u(e),n.domain([t[0],o.peek(t)]),a):t.slice()},a.range=function(e){return arguments.length?(n.range(e),a):n.range()},a.rangeRound=function(e){return arguments.length?(n.rangeRound(e),a):n.rangeRound()},a.interpolate=function(e){return arguments.length?(n.interpolate(e),a):n.interpolate()},a.invert=function(e){return n.invert(e)},a.ticks=function(e){var n=t.length,r=~~(n/(e||n));return r<2?a.domain():t.filter(function(e,n){return!(n%r)})},a.tickFormat=function(){return n.tickFormat.apply(n,arguments)},a.copy=function(){return e().domain(a.domain()).range(a.range())},a},"bin-ordinal":function e(){var n=[],r=[];function t(e){return null==e||e!=e?void 0:r[(g.bisect(n,e)-1)%r.length]}return t.domain=function(e){return arguments.length?(n=u(e),t):n.slice()},t.range=function(e){return arguments.length?(r=c.call(e),t):r.slice()},t.copy=function(){return e().domain(t.domain()).range(t.range())},t}};for(var f in l)d(f,l[f]);function s(n,e){var r=e-n;return function(e){return n+e*r}}function b(e){for(var n=e.length/6|0,r=new Array(n),t=0;t<n;)r[t]="#"+e.slice(6*t,6*++t);return r}var p=b("1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5"),v=b("393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6"),y=b("3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9"),w=b("4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac"),R=b("4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"),M=new Array(3).concat("67a9cff7f7f7f1a340","0571b092c5defdb863e66101","0571b092c5def7f7f7fdb863e66101","2166ac67a9cfd1e5f0fee0b6f1a340b35806","2166ac67a9cfd1e5f0f7f7f7fee0b6f1a340b35806","2166ac4393c392c5ded1e5f0fee0b6fdb863e08214b35806","2166ac4393c392c5ded1e5f0f7f7f7fee0b6fdb863e08214b35806","0530612166ac4393c392c5ded1e5f0fee0b6fdb863e08214b358067f3b08","0530612166ac4393c392c5ded1e5f0f7f7f7fee0b6fdb863e08214b358067f3b08").map(b),k={blueorange:M},P={category10:r.schemeCategory10,accent:r.schemeAccent,dark2:r.schemeDark2,paired:r.schemePaired,pastel1:r.schemePastel1,pastel2:r.schemePastel2,set1:r.schemeSet1,set2:r.schemeSet2,set3:r.schemeSet3,category20:p,category20b:v,category20c:y,tableau10:w,tableau20:R,viridis:r.interpolateViridis,magma:r.interpolateMagma,inferno:r.interpolateInferno,plasma:r.interpolatePlasma,rainbow:r.interpolateRainbow,sinebow:r.interpolateSinebow,blueorange:a.interpolateRgbBasis(o.peek(M))};function O(e,n){P[e]=r["interpolate"+n],k[e]=r["scheme"+n]}O("blues","Blues"),O("greens","Greens"),O("greys","Greys"),O("purples","Purples"),O("reds","Reds"),O("oranges","Oranges"),O("brownbluegreen","BrBG"),O("purplegreen","PRGn"),O("pinkyellowgreen","PiYG"),O("purpleorange","PuOr"),O("redblue","RdBu"),O("redgrey","RdGy"),O("redyellowblue","RdYlBu"),O("redyellowgreen","RdYlGn"),O("spectral","Spectral"),O("bluegreen","BuGn"),O("bluepurple","BuPu"),O("greenblue","GnBu"),O("orangered","OrRd"),O("purplebluegreen","PuBuGn"),O("purpleblue","PuBu"),O("purplered","PuRd"),O("redpurple","RdPu"),O("yellowgreenblue","YlGnBu"),O("yellowgreen","YlGn"),O("yelloworangebrown","YlOrBr"),O("yelloworangered","YlOrRd");var B={millisecond:n.timeMillisecond,second:n.timeSecond,minute:n.timeMinute,hour:n.timeHour,day:n.timeDay,week:n.timeWeek,month:n.timeMonth,year:n.timeYear},q={millisecond:n.utcMillisecond,second:n.utcSecond,minute:n.utcMinute,hour:n.utcHour,day:n.utcDay,week:n.utcWeek,month:n.utcMonth,year:n.utcYear};e.scaleImplicit=m.scaleImplicit,e.bandSpace=h,e.scale=d,e.interpolate=function(e,n){var r,t=a[(r=e,"interpolate"+r.toLowerCase().split("-").map(function(e){return e[0].toUpperCase()+e.slice(1)}).join(""))];return null!=n&&t&&t.gamma?t.gamma(n):t},e.interpolateRange=function(n,e){var r=e[0],t=o.peek(e)-r;return function(e){return n(r+e*t)}},e.scaleFraction=function(e,n,r){var t=r-n;return t?"linear"===e.type||"sequential"===e.type?function(e){return(e-n)/t}:e.copy().domain([n,r]).range([0,1]).interpolate(s):o.constant(0)},e.scheme=function(e,n){if(1<arguments.length)return P[e]=n,this;var r=e.split("-");return e=r[0],(r=+r[1]+1)&&k.hasOwnProperty(e)?k[e][r-1]:!r&&P.hasOwnProperty(e)?P[e]:void 0},e.schemeDiscretized=function(e,n,r){return 1<arguments.length?(k[e]=n,P[e]=r||a.interpolateRgbBasis(o.peek(n)),this):k.hasOwnProperty(e)?k[e]:void 0},e.timeInterval=function(e){return B.hasOwnProperty(e)&&B[e]},e.utcInterval=function(e){return q.hasOwnProperty(e)&&q[e]},Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("d3-array"),require("d3-scale"),require("vega-util"),require("d3-interpolate"),require("d3-scale-chromatic"),require("d3-time")):"function"==typeof define&&define.amd?define(["exports","d3-array","d3-scale","vega-util","d3-interpolate","d3-scale-chromatic","d3-time"],n):n(e.vega={},e.d3,e.d3,e.vega,e.d3,e.d3,e.d3)}(this,function(e,g,m,u,a,r,n){"use strict";function h(e,n,r){var t=e-n+2*r;return e?0<t?t:1:0}function t(){var c,d,r=m.scaleOrdinal().unknown(void 0),l=r.domain,f=r.range,s=[0,1],o=!1,u=0,b=0,p=.5;function n(){var e=l().length,n=s[1]<s[0],r=s[n-0],t=s[1-n],a=h(e,u,b);c=(t-r)/(a||1),o&&(c=Math.floor(c)),r+=(t-r-c*(e-u))*p,d=c*(1-u),o&&(r=Math.round(r),d=Math.round(d));var i=g.range(e).map(function(e){return r+c*e});return f(n?i.reverse():i)}return delete r.unknown,r.domain=function(e){return arguments.length?(l(e),n()):l()},r.range=function(e){return arguments.length?(s=[+e[0],+e[1]],n()):s.slice()},r.rangeRound=function(e){return s=[+e[0],+e[1]],o=!0,n()},r.bandwidth=function(){return d},r.step=function(){return c},r.round=function(e){return arguments.length?(o=!!e,n()):o},r.padding=function(e){return arguments.length?(b=Math.max(0,Math.min(1,e)),u=b,n()):u},r.paddingInner=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),n()):u},r.paddingOuter=function(e){return arguments.length?(b=Math.max(0,Math.min(1,e)),n()):b},r.align=function(e){return arguments.length?(p=Math.max(0,Math.min(1,e)),n()):p},r.invertRange=function(e){if(null!=e[0]&&null!=e[1]){var n,r,t,a=+e[0],i=+e[1],c=s[1]<s[0],o=c?f().reverse():f(),u=o.length-1;if(a==a&&i==i&&(i<a&&(t=a,a=i,i=t),!(i<o[0]||a>s[1-c])))return n=Math.max(0,g.bisectRight(o,a)-1),r=a===i?n:g.bisectRight(o,i)-1,a-o[n]>d+1e-10&&++n,c&&(t=n,n=u-r,r=u-t),r<n?void 0:l().slice(n,r+1)}},r.invert=function(e){var n=r.invertRange([e,e]);return n?n[0]:n},r.copy=function(){return t().domain(l()).range(s).round(o).paddingInner(u).paddingOuter(b).align(p)},n()}var i=Array.prototype.map,c=Array.prototype.slice;function o(e){return i.call(e,function(e){return+e})}function d(e,n){return 1<arguments.length?(l[e]=(r=e,t=n,function(){var d,a,e=t();return e.invertRange||(e.invertRange=e.invert?(a=e,function(e){var n,r=e[0],t=e[1];return t<r&&(n=r,r=t,t=n),[a.invert(r),a.invert(t)]}):e.invertExtent?(d=e,function(e){var n,r,t,a,i=d.range(),c=e[0],o=e[1],u=-1;for(o<c&&(r=c,c=o,o=r),t=0,a=i.length;t<a;++t)i[t]>=c&&i[t]<=o&&(u<0&&(u=t),n=t);if(!(u<0))return c=d.invertExtent(i[u]),o=d.invertExtent(i[n]),[void 0===c[0]?c[1]:c[0],void 0===o[1]?o[0]:o[1]]}):void 0),e.type=r,e}),this):l.hasOwnProperty(e)?l[e]:void 0;var r,t}var l={identity:m.scaleIdentity,linear:m.scaleLinear,log:m.scaleLog,ordinal:m.scaleOrdinal,pow:m.scalePow,sqrt:m.scaleSqrt,quantile:m.scaleQuantile,quantize:m.scaleQuantize,threshold:m.scaleThreshold,time:m.scaleTime,utc:m.scaleUtc,band:t,point:function(){return function e(n){var r=n.copy;return n.padding=n.paddingOuter,delete n.paddingInner,n.copy=function(){return e(r())},n}(t().paddingInner(1))},sequential:function e(r){var t=m.scaleLinear(),a=0,i=1,c=!1;function n(){var e=t.domain();a=e[0],i=u.peek(e)-a}function o(e){var n=(e-a)/i;return r(c?Math.max(0,Math.min(1,n)):n)}return o.clamp=function(e){return arguments.length?(c=!!e,o):c},o.domain=function(e){return arguments.length?(t.domain(e),n(),o):t.domain()},o.interpolator=function(e){return arguments.length?(r=e,o):r},o.copy=function(){return e().domain(t.domain()).clamp(c).interpolator(r)},o.ticks=function(e){return t.ticks(e)},o.tickFormat=function(e,n){return t.tickFormat(e,n)},o.nice=function(e){return t.nice(e),n(),o},o},"bin-linear":function e(){var n=m.scaleLinear(),t=[];function a(e){return n(e)}return a.domain=function(e){return arguments.length?(t=o(e),n.domain([t[0],u.peek(t)]),a):t.slice()},a.range=function(e){return arguments.length?(n.range(e),a):n.range()},a.rangeRound=function(e){return arguments.length?(n.rangeRound(e),a):n.rangeRound()},a.interpolate=function(e){return arguments.length?(n.interpolate(e),a):n.interpolate()},a.invert=function(e){return n.invert(e)},a.ticks=function(e){var n=t.length,r=~~(n/(e||n));return r<2?a.domain():t.filter(function(e,n){return!(n%r)})},a.tickFormat=function(){return n.tickFormat.apply(n,arguments)},a.copy=function(){return e().domain(a.domain()).range(a.range())},a},"bin-ordinal":function e(){var n=[],r=[];function t(e){return null==e||e!=e?void 0:r[(g.bisect(n,e)-1)%r.length]}return t.domain=function(e){return arguments.length?(n=o(e),t):n.slice()},t.range=function(e){return arguments.length?(r=c.call(e),t):r.slice()},t.tickFormat=function(){var e=m.scaleLinear().domain([n[0],u.peek(n)]);return e.tickFormat.apply(e,arguments)},t.copy=function(){return e().domain(t.domain()).range(t.range())},t}};for(var f in l)d(f,l[f]);function s(n,e){var r=e-n;return function(e){return n+e*r}}function b(e){for(var n=e.length/6|0,r=new Array(n),t=0;t<n;)r[t]="#"+e.slice(6*t,6*++t);return r}var p=b("1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5"),v=b("393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6"),y=b("3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9"),w=b("4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac"),k=b("4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"),R=new Array(3).concat("67a9cff7f7f7f1a340","0571b092c5defdb863e66101","0571b092c5def7f7f7fdb863e66101","2166ac67a9cfd1e5f0fee0b6f1a340b35806","2166ac67a9cfd1e5f0f7f7f7fee0b6f1a340b35806","2166ac4393c392c5ded1e5f0fee0b6fdb863e08214b35806","2166ac4393c392c5ded1e5f0f7f7f7fee0b6fdb863e08214b35806","0530612166ac4393c392c5ded1e5f0fee0b6fdb863e08214b358067f3b08","0530612166ac4393c392c5ded1e5f0f7f7f7fee0b6fdb863e08214b358067f3b08").map(b),M={blueorange:R},P={category10:r.schemeCategory10,accent:r.schemeAccent,dark2:r.schemeDark2,paired:r.schemePaired,pastel1:r.schemePastel1,pastel2:r.schemePastel2,set1:r.schemeSet1,set2:r.schemeSet2,set3:r.schemeSet3,category20:p,category20b:v,category20c:y,tableau10:w,tableau20:k,viridis:r.interpolateViridis,magma:r.interpolateMagma,inferno:r.interpolateInferno,plasma:r.interpolatePlasma,rainbow:r.interpolateRainbow,sinebow:r.interpolateSinebow,blueorange:a.interpolateRgbBasis(u.peek(R))};function O(e,n){P[e]=r["interpolate"+n],M[e]=r["scheme"+n]}O("blues","Blues"),O("greens","Greens"),O("greys","Greys"),O("purples","Purples"),O("reds","Reds"),O("oranges","Oranges"),O("brownbluegreen","BrBG"),O("purplegreen","PRGn"),O("pinkyellowgreen","PiYG"),O("purpleorange","PuOr"),O("redblue","RdBu"),O("redgrey","RdGy"),O("redyellowblue","RdYlBu"),O("redyellowgreen","RdYlGn"),O("spectral","Spectral"),O("bluegreen","BuGn"),O("bluepurple","BuPu"),O("greenblue","GnBu"),O("orangered","OrRd"),O("purplebluegreen","PuBuGn"),O("purpleblue","PuBu"),O("purplered","PuRd"),O("redpurple","RdPu"),O("yellowgreenblue","YlGnBu"),O("yellowgreen","YlGn"),O("yelloworangebrown","YlOrBr"),O("yelloworangered","YlOrRd");var B={millisecond:n.timeMillisecond,second:n.timeSecond,minute:n.timeMinute,hour:n.timeHour,day:n.timeDay,week:n.timeWeek,month:n.timeMonth,year:n.timeYear},q={millisecond:n.utcMillisecond,second:n.utcSecond,minute:n.utcMinute,hour:n.utcHour,day:n.utcDay,week:n.utcWeek,month:n.utcMonth,year:n.utcYear};e.scaleImplicit=m.scaleImplicit,e.bandSpace=h,e.scale=d,e.interpolate=function(e,n){var r,t=a[(r=e,"interpolate"+r.toLowerCase().split("-").map(function(e){return e[0].toUpperCase()+e.slice(1)}).join(""))];return null!=n&&t&&t.gamma?t.gamma(n):t},e.interpolateRange=function(n,e){var r=e[0],t=u.peek(e)-r;return function(e){return n(r+e*t)}},e.scaleFraction=function(e,n,r){var t=r-n;return t&&isFinite(t)?"linear"===e.type||"sequential"===e.type?function(e){return(e-n)/t}:e.copy().domain([n,r]).range([0,1]).interpolate(s):u.constant(0)},e.scheme=function(e,n){if(1<arguments.length)return P[e]=n,this;var r=e.split("-");return e=r[0],(r=+r[1]+1)&&M.hasOwnProperty(e)?M[e][r-1]:!r&&P.hasOwnProperty(e)?P[e]:void 0},e.schemeDiscretized=function(e,n,r){return 1<arguments.length?(M[e]=n,P[e]=r||a.interpolateRgbBasis(u.peek(n)),this):M.hasOwnProperty(e)?M[e]:void 0},e.timeInterval=function(e){return B.hasOwnProperty(e)&&B[e]},e.utcInterval=function(e){return q.hasOwnProperty(e)&&q[e]},Object.defineProperty(e,"__esModule",{value:!0})});
{
"name": "vega-scale",
"version": "2.4.0",
"version": "2.5.0",
"description": "Scales and color schemes for visual encoding.",

@@ -31,12 +31,12 @@ "keywords": [

"dependencies": {
"d3-array": "^1.2.1",
"d3-interpolate": "^1.2.0",
"d3-scale": "^2.1.0",
"d3-scale-chromatic": "^1.3.0",
"d3-time": "^1.0.8",
"d3-array": "^1.2.4",
"d3-interpolate": "^1.3.2",
"d3-scale": "^2.1.2",
"d3-scale-chromatic": "^1.3.3",
"d3-time": "^1.0.10",
"vega-util": "^1.7.0"
},
"devDependencies": {
"eslint": "4",
"rollup": "0.60.7",
"eslint": "5",
"rollup": "0.66.6",
"tape": "4",

@@ -43,0 +43,0 @@ "uglify-js": "3"

@@ -12,3 +12,3 @@ import {constant, peek} from 'vega-util';

var delta = max - min;
return !delta ? constant(0)
return !delta || !isFinite(delta) ? constant(0)
: scale.type === 'linear' || scale.type === 'sequential'

@@ -15,0 +15,0 @@ ? function(_) { return (_ - min) / delta; }

@@ -93,2 +93,8 @@ import {bisect} from 'd3-array';

// Addresses #1395, refine if/when d3-scale tickFormat is exposed
scale.tickFormat = function() {
var linear = scaleLinear().domain([domain[0], peek(domain)]);
return linear.tickFormat.apply(linear, arguments);
};
scale.copy = function() {

@@ -95,0 +101,0 @@ return binOrdinal().domain(scale.domain()).range(scale.range());

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