vega-scale
Advanced tools
Comparing version 2.0.2 to 2.1.0
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-array'), require('d3-scale'), require('vega-util'), require('d3-scale-chromatic'), require('d3-interpolate')) : | ||
typeof define === 'function' && define.amd ? define(['exports', 'd3-array', 'd3-scale', 'vega-util', 'd3-scale-chromatic', 'd3-interpolate'], factory) : | ||
(factory((global.vega = global.vega || {}),global.d3,global.d3,global.vega,global.d3,global.d3)); | ||
}(this, (function (exports,d3Array,$,vegaUtil,_,$$1) { 'use strict'; | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-array'), require('d3-scale'), require('vega-util'), require('d3-scale-chromatic'), require('d3-interpolate'), require('d3-time')) : | ||
typeof define === 'function' && define.amd ? define(['exports', 'd3-array', 'd3-scale', 'vega-util', 'd3-scale-chromatic', 'd3-interpolate', 'd3-time'], factory) : | ||
(factory((global.vega = global.vega || {}),global.d3,global.d3,global.vega,global.d3,global.d3,global.d3)); | ||
}(this, (function (exports,d3Array,$,vegaUtil,_,$$1,d3Time) { 'use strict'; | ||
@@ -599,2 +599,32 @@ var invertRange = function(scale) { | ||
var time = { | ||
millisecond: d3Time.timeMillisecond, | ||
second: d3Time.timeSecond, | ||
minute: d3Time.timeMinute, | ||
hour: d3Time.timeHour, | ||
day: d3Time.timeDay, | ||
week: d3Time.timeWeek, | ||
month: d3Time.timeMonth, | ||
year: d3Time.timeYear | ||
}; | ||
var utc = { | ||
millisecond: d3Time.utcMillisecond, | ||
second: d3Time.utcSecond, | ||
minute: d3Time.utcMinute, | ||
hour: d3Time.utcHour, | ||
day: d3Time.utcDay, | ||
week: d3Time.utcWeek, | ||
month: d3Time.utcMonth, | ||
year: d3Time.utcYear | ||
}; | ||
function timeInterval(name) { | ||
return time.hasOwnProperty(name) && time[name]; | ||
} | ||
function utcInterval(name) { | ||
return utc.hasOwnProperty(name) && utc[name]; | ||
} | ||
exports.scale = scale; | ||
@@ -606,2 +636,4 @@ exports.scheme = schemes$1; | ||
exports.scaleFraction = scaleFraction; | ||
exports.timeInterval = timeInterval; | ||
exports.utcInterval = utcInterval; | ||
@@ -608,0 +640,0 @@ Object.defineProperty(exports, '__esModule', { value: true }); |
@@ -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-scale-chromatic"),require("d3-interpolate")):"function"==typeof define&&define.amd?define(["exports","d3-array","d3-scale","vega-util","d3-scale-chromatic","d3-interpolate"],n):n(e.vega=e.vega||{},e.d3,e.d3,e.vega,e.d3,e.d3)}(this,function(e,n,r,t,a,i){"use strict";function u(){function e(){var e=o().length,r=l[1]<l[0],i=l[r-0],u=l[1-r],p=R(e,d,g);t=(u-i)/(p||1),f&&(t=Math.floor(t)),i+=(u-i-t*(e-d))*s,a=t*(1-d),f&&(i=Math.round(i),a=Math.round(a));var b=n.range(e).map(function(e){return i+t*e});return c(r?b.reverse():b)}var t,a,i=r.scaleOrdinal().unknown(void 0),o=i.domain,c=i.range,l=[0,1],f=!1,d=0,g=0,s=.5;return delete i.unknown,i.domain=function(n){return arguments.length?(o(n),e()):o()},i.range=function(n){return arguments.length?(l=[+n[0],+n[1]],e()):l.slice()},i.rangeRound=function(n){return l=[+n[0],+n[1]],f=!0,e()},i.bandwidth=function(){return a},i.step=function(){return t},i.round=function(n){return arguments.length?(f=!!n,e()):f},i.padding=function(n){return arguments.length?(g=Math.max(0,Math.min(1,n)),d=g,e()):d},i.paddingInner=function(n){return arguments.length?(d=Math.max(0,Math.min(1,n)),e()):d},i.paddingOuter=function(n){return arguments.length?(g=Math.max(0,Math.min(1,n)),e()):g},i.align=function(n){return arguments.length?(s=Math.max(0,Math.min(1,n)),e()):s},i.invertRange=function(e){if(null!=e[0]&&null!=e[1]){var r,t,i,u=+e[0],f=+e[1],d=l[1]<l[0],g=d?c().reverse():c(),s=g.length-1;if(u===u&&f===f&&(f<u&&(i=u,u=f,f=i),!(f<g[0]||u>l[1-d])))return r=Math.max(0,n.bisectRight(g,u)-1),t=u===f?r:n.bisectRight(g,f)-1,u-g[r]>a+1e-10&&++r,d&&(i=r,r=s-t,t=s-i),r>t?void 0:o().slice(r,t+1)}},i.invert=function(e){var n=i.invertRange([e,e]);return n?n[0]:n},i.copy=function(){return u().domain(o()).range(l).round(f).paddingInner(d).paddingOuter(g).align(s)},e()}function o(e){var n=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return o(n())},e}function c(e){return w.call(e,function(e){return+e})}function l(){function e(e){return a(e)}function n(e){i=c(e),a.domain([i[0],t.peek(i)])}var a=r.scaleLinear(),i=[];return e.domain=function(r){return arguments.length?(n(r),e):i.slice()},e.range=function(n){return arguments.length?(a.range(n),e):a.range()},e.rangeRound=function(n){return arguments.length?(a.rangeRound(n),e):a.rangeRound()},e.interpolate=function(n){return arguments.length?(a.interpolate(n),e):a.interpolate()},e.invert=function(e){return a.invert(e)},e.ticks=function(n){var r=i.length,t=~~(r/(n||r));return t<2?e.domain():i.filter(function(e,n){return!(n%t)})},e.tickFormat=function(){return a.tickFormat.apply(a,arguments)},e.copy=function(){return l().domain(e.domain()).range(e.range())},e}function f(){function e(e){return null==e||e!==e?void 0:t[(n.bisect(r,e)-1)%t.length]}var r=[],t=[];return e.domain=function(n){return arguments.length?(r=c(n),e):r.slice()},e.range=function(n){return arguments.length?(t=P.call(n),e):t.slice()},e.copy=function(){return f().domain(e.domain()).range(e.range())},e}function d(e){function n(){var e=i.domain();u=e[0],o=t.peek(e)-u}function a(n){var r=(n-u)/o;return e(c?Math.max(0,Math.min(1,r)):r)}var i=r.scaleLinear(),u=0,o=1,c=!1;return a.clamp=function(e){return arguments.length?(c=!!e,a):c},a.domain=function(e){return arguments.length?(i.domain(e),n(),a):i.domain()},a.interpolator=function(n){return arguments.length?(e=n,a):e},a.copy=function(){return d().domain(i.domain()).clamp(c).interpolator(e)},a.ticks=function(e){return i.ticks(e)},a.tickFormat=function(e,n){return i.tickFormat(e,n)},a.nice=function(e){return i.nice(e),n(),a},a}function g(e,n){return function(){var r=n();return r.invertRange||(r.invertRange=r.invert?v(r):r.invertExtent?y(r):void 0),r.type=e,r}}function s(e,n){return arguments.length>1?(k[e]=g(e,n),this):k.hasOwnProperty(e)?k[e]:void 0}function p(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}function b(e,n){q[e]=a["interpolate"+n],G[e]=a["scheme"+n]}function m(e,n){var r=n-e;return function(n){return e+n*r}}function h(e){return"interpolate"+e.toLowerCase().split("-").map(function(e){return e[0].toUpperCase()+e.slice(1)}).join("")}var v=function(e){return function(n){var r,t=n[0],a=n[1];return a<t&&(r=t,t=a,a=r),[e.invert(t),e.invert(a)]}},y=function(e){return function(n){var r,t,a,i,u=e.range(),o=n[0],c=n[1],l=-1;for(c<o&&(t=o,o=c,c=t),a=0,i=u.length;a<i;++a)u[a]>=o&&u[a]<=c&&(l<0&&(l=a),r=a);if(!(l<0))return o=e.invertExtent(u[l]),c=e.invertExtent(u[r]),[void 0===o[0]?o[1]:o[0],void 0===c[1]?c[0]:c[1]]}},R=function(e,n,r){var t=e-n+2*r;return e?t>0?t:1:0},w=Array.prototype.map,P=Array.prototype.slice,k={identity:r.scaleIdentity,linear:r.scaleLinear,log:r.scaleLog,ordinal:r.scaleOrdinal,pow:r.scalePow,sqrt:r.scaleSqrt,quantile:r.scaleQuantile,quantize:r.scaleQuantize,threshold:r.scaleThreshold,time:r.scaleTime,utc:r.scaleUtc,band:u,point:function(){return o(u().paddingInner(1))},sequential:d,"bin-linear":l,"bin-ordinal":f};for(var M in k)s(M,k[M]);var O=p("4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac"),B=p("4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"),x=new Array(3).concat("67a9cff7f7f7f1a340","0571b092c5defdb863e66101","0571b092c5def7f7f7fdb863e66101","2166ac67a9cfd1e5f0fee0b6f1a340b35806","2166ac67a9cfd1e5f0f7f7f7fee0b6f1a340b35806","2166ac4393c392c5ded1e5f0fee0b6fdb863e08214b35806","2166ac4393c392c5ded1e5f0f7f7f7fee0b6fdb863e08214b35806","0530612166ac4393c392c5ded1e5f0fee0b6fdb863e08214b358067f3b08","0530612166ac4393c392c5ded1e5f0f7f7f7fee0b6fdb863e08214b358067f3b08").map(p),G={blueorange:x},q={category10:r.schemeCategory10,category20:r.schemeCategory20,category20b:r.schemeCategory20b,category20c:r.schemeCategory20c,accent:a.schemeAccent,dark2:a.schemeDark2,paired:a.schemePaired,pastel1:a.schemePastel1,pastel2:a.schemePastel2,set1:a.schemeSet1,set2:a.schemeSet2,set3:a.schemeSet3,tableau10:O,tableau20:B,viridis:r.interpolateViridis,magma:r.interpolateMagma,inferno:r.interpolateInferno,plasma:r.interpolatePlasma,blueorange:i.interpolateRgbBasis(t.peek(x))};b("blues","Blues"),b("greens","Greens"),b("greys","Greys"),b("purples","Purples"),b("reds","Reds"),b("oranges","Oranges"),b("brownbluegreen","BrBG"),b("purplegreen","PRGn"),b("pinkyellowgreen","PiYG"),b("purpleorange","PuOr"),b("redblue","RdBu"),b("redgrey","RdGy"),b("redyellowblue","RdYlBu"),b("redyellowgreen","RdYlGn"),b("spectral","Spectral"),b("bluegreen","BuGn"),b("bluepurple","BuPu"),b("greenblue","GnBu"),b("orangered","OrRd"),b("purplebluegreen","PuBuGn"),b("purpleblue","PuBu"),b("purplered","PuRd"),b("redpurple","RdPu"),b("yellowgreenblue","YlGnBu"),b("yellowgreen","YlGn"),b("yelloworangebrown","YlOrBr"),b("yelloworangered","YlOrRd");e.scale=s,e.scheme=function(e,n){if(arguments.length>1)return q[e]=n,this;var r=e.split("-");return e=r[0],(r=+r[1]+1)&&G.hasOwnProperty(e)?G[e][r-1]:!r&&q.hasOwnProperty(e)?q[e]:void 0},e.bandSpace=R,e.interpolate=function(e,n){var r=i[h(e)];return null!=n&&r&&r.gamma?r.gamma(n):r},e.interpolateRange=function(e,n){var r=n[0],a=t.peek(n)-r;return function(n){return e(r+n*a)}},e.scaleFraction=function(e,n,r){var a=r-n;return a?"linear"===e.type||"sequential"===e.type?function(e){return(e-n)/a}:e.copy().domain([n,r]).range([0,1]).interpolate(m):t.constant(0)},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-scale-chromatic"),require("d3-interpolate"),require("d3-time")):"function"==typeof define&&define.amd?define(["exports","d3-array","d3-scale","vega-util","d3-scale-chromatic","d3-interpolate","d3-time"],n):n(e.vega=e.vega||{},e.d3,e.d3,e.vega,e.d3,e.d3,e.d3)}(this,function(e,n,r,t,a,i,u){"use strict";function o(){function e(){var e=u().length,r=l[1]<l[0],i=l[r-0],o=l[1-r],p=M(e,f,s);t=(o-i)/(p||1),d&&(t=Math.floor(t)),i+=(o-i-t*(e-f))*g,a=t*(1-f),d&&(i=Math.round(i),a=Math.round(a));var m=n.range(e).map(function(e){return i+t*e});return c(r?m.reverse():m)}var t,a,i=r.scaleOrdinal().unknown(void 0),u=i.domain,c=i.range,l=[0,1],d=!1,f=0,s=0,g=.5;return delete i.unknown,i.domain=function(n){return arguments.length?(u(n),e()):u()},i.range=function(n){return arguments.length?(l=[+n[0],+n[1]],e()):l.slice()},i.rangeRound=function(n){return l=[+n[0],+n[1]],d=!0,e()},i.bandwidth=function(){return a},i.step=function(){return t},i.round=function(n){return arguments.length?(d=!!n,e()):d},i.padding=function(n){return arguments.length?(s=Math.max(0,Math.min(1,n)),f=s,e()):f},i.paddingInner=function(n){return arguments.length?(f=Math.max(0,Math.min(1,n)),e()):f},i.paddingOuter=function(n){return arguments.length?(s=Math.max(0,Math.min(1,n)),e()):s},i.align=function(n){return arguments.length?(g=Math.max(0,Math.min(1,n)),e()):g},i.invertRange=function(e){if(null!=e[0]&&null!=e[1]){var r,t,i,o=+e[0],d=+e[1],f=l[1]<l[0],s=f?c().reverse():c(),g=s.length-1;if(o===o&&d===d&&(d<o&&(i=o,o=d,d=i),!(d<s[0]||o>l[1-f])))return r=Math.max(0,n.bisectRight(s,o)-1),t=o===d?r:n.bisectRight(s,d)-1,o-s[r]>a+1e-10&&++r,f&&(i=r,r=g-t,t=g-i),r>t?void 0:u().slice(r,t+1)}},i.invert=function(e){var n=i.invertRange([e,e]);return n?n[0]:n},i.copy=function(){return o().domain(u()).range(l).round(d).paddingInner(f).paddingOuter(s).align(g)},e()}function c(e){var n=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,e.copy=function(){return c(n())},e}function l(e){return R.call(e,function(e){return+e})}function d(){function e(e){return a(e)}function n(e){i=l(e),a.domain([i[0],t.peek(i)])}var a=r.scaleLinear(),i=[];return e.domain=function(r){return arguments.length?(n(r),e):i.slice()},e.range=function(n){return arguments.length?(a.range(n),e):a.range()},e.rangeRound=function(n){return arguments.length?(a.rangeRound(n),e):a.rangeRound()},e.interpolate=function(n){return arguments.length?(a.interpolate(n),e):a.interpolate()},e.invert=function(e){return a.invert(e)},e.ticks=function(n){var r=i.length,t=~~(r/(n||r));return t<2?e.domain():i.filter(function(e,n){return!(n%t)})},e.tickFormat=function(){return a.tickFormat.apply(a,arguments)},e.copy=function(){return d().domain(e.domain()).range(e.range())},e}function f(){function e(e){return null==e||e!==e?void 0:t[(n.bisect(r,e)-1)%t.length]}var r=[],t=[];return e.domain=function(n){return arguments.length?(r=l(n),e):r.slice()},e.range=function(n){return arguments.length?(t=k.call(n),e):t.slice()},e.copy=function(){return f().domain(e.domain()).range(e.range())},e}function s(e){function n(){var e=i.domain();u=e[0],o=t.peek(e)-u}function a(n){var r=(n-u)/o;return e(c?Math.max(0,Math.min(1,r)):r)}var i=r.scaleLinear(),u=0,o=1,c=!1;return a.clamp=function(e){return arguments.length?(c=!!e,a):c},a.domain=function(e){return arguments.length?(i.domain(e),n(),a):i.domain()},a.interpolator=function(n){return arguments.length?(e=n,a):e},a.copy=function(){return s().domain(i.domain()).clamp(c).interpolator(e)},a.ticks=function(e){return i.ticks(e)},a.tickFormat=function(e,n){return i.tickFormat(e,n)},a.nice=function(e){return i.nice(e),n(),a},a}function g(e,n){return function(){var r=n();return r.invertRange||(r.invertRange=r.invert?y(r):r.invertExtent?w(r):void 0),r.type=e,r}}function p(e,n){return arguments.length>1?(P[e]=g(e,n),this):P.hasOwnProperty(e)?P[e]:void 0}function m(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}function h(e,n){Y[e]=a["interpolate"+n],G[e]=a["scheme"+n]}function b(e,n){var r=n-e;return function(n){return e+n*r}}function v(e){return"interpolate"+e.toLowerCase().split("-").map(function(e){return e[0].toUpperCase()+e.slice(1)}).join("")}var y=function(e){return function(n){var r,t=n[0],a=n[1];return a<t&&(r=t,t=a,a=r),[e.invert(t),e.invert(a)]}},w=function(e){return function(n){var r,t,a,i,u=e.range(),o=n[0],c=n[1],l=-1;for(c<o&&(t=o,o=c,c=t),a=0,i=u.length;a<i;++a)u[a]>=o&&u[a]<=c&&(l<0&&(l=a),r=a);if(!(l<0))return o=e.invertExtent(u[l]),c=e.invertExtent(u[r]),[void 0===o[0]?o[1]:o[0],void 0===c[1]?c[0]:c[1]]}},M=function(e,n,r){var t=e-n+2*r;return e?t>0?t:1:0},R=Array.prototype.map,k=Array.prototype.slice,P={identity:r.scaleIdentity,linear:r.scaleLinear,log:r.scaleLog,ordinal:r.scaleOrdinal,pow:r.scalePow,sqrt:r.scaleSqrt,quantile:r.scaleQuantile,quantize:r.scaleQuantize,threshold:r.scaleThreshold,time:r.scaleTime,utc:r.scaleUtc,band:o,point:function(){return c(o().paddingInner(1))},sequential:s,"bin-linear":d,"bin-ordinal":f};for(var O in P)p(O,P[O]);var B=m("4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac"),q=m("4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"),x=new Array(3).concat("67a9cff7f7f7f1a340","0571b092c5defdb863e66101","0571b092c5def7f7f7fdb863e66101","2166ac67a9cfd1e5f0fee0b6f1a340b35806","2166ac67a9cfd1e5f0f7f7f7fee0b6f1a340b35806","2166ac4393c392c5ded1e5f0fee0b6fdb863e08214b35806","2166ac4393c392c5ded1e5f0f7f7f7fee0b6fdb863e08214b35806","0530612166ac4393c392c5ded1e5f0fee0b6fdb863e08214b358067f3b08","0530612166ac4393c392c5ded1e5f0f7f7f7fee0b6fdb863e08214b358067f3b08").map(m),G={blueorange:x},Y={category10:r.schemeCategory10,category20:r.schemeCategory20,category20b:r.schemeCategory20b,category20c:r.schemeCategory20c,accent:a.schemeAccent,dark2:a.schemeDark2,paired:a.schemePaired,pastel1:a.schemePastel1,pastel2:a.schemePastel2,set1:a.schemeSet1,set2:a.schemeSet2,set3:a.schemeSet3,tableau10:B,tableau20:q,viridis:r.interpolateViridis,magma:r.interpolateMagma,inferno:r.interpolateInferno,plasma:r.interpolatePlasma,blueorange:i.interpolateRgbBasis(t.peek(x))};h("blues","Blues"),h("greens","Greens"),h("greys","Greys"),h("purples","Purples"),h("reds","Reds"),h("oranges","Oranges"),h("brownbluegreen","BrBG"),h("purplegreen","PRGn"),h("pinkyellowgreen","PiYG"),h("purpleorange","PuOr"),h("redblue","RdBu"),h("redgrey","RdGy"),h("redyellowblue","RdYlBu"),h("redyellowgreen","RdYlGn"),h("spectral","Spectral"),h("bluegreen","BuGn"),h("bluepurple","BuPu"),h("greenblue","GnBu"),h("orangered","OrRd"),h("purplebluegreen","PuBuGn"),h("purpleblue","PuBu"),h("purplered","PuRd"),h("redpurple","RdPu"),h("yellowgreenblue","YlGnBu"),h("yellowgreen","YlGn"),h("yelloworangebrown","YlOrBr"),h("yelloworangered","YlOrRd");var I={millisecond:u.timeMillisecond,second:u.timeSecond,minute:u.timeMinute,hour:u.timeHour,day:u.timeDay,week:u.timeWeek,month:u.timeMonth,year:u.timeYear},S={millisecond:u.utcMillisecond,second:u.utcSecond,minute:u.utcMinute,hour:u.utcHour,day:u.utcDay,week:u.utcWeek,month:u.utcMonth,year:u.utcYear};e.scale=p,e.scheme=function(e,n){if(arguments.length>1)return Y[e]=n,this;var r=e.split("-");return e=r[0],(r=+r[1]+1)&&G.hasOwnProperty(e)?G[e][r-1]:!r&&Y.hasOwnProperty(e)?Y[e]:void 0},e.bandSpace=M,e.interpolate=function(e,n){var r=i[v(e)];return null!=n&&r&&r.gamma?r.gamma(n):r},e.interpolateRange=function(e,n){var r=n[0],a=t.peek(n)-r;return function(n){return e(r+n*a)}},e.scaleFraction=function(e,n,r){var a=r-n;return a?"linear"===e.type||"sequential"===e.type?function(e){return(e-n)/a}:e.copy().domain([n,r]).range([0,1]).interpolate(b):t.constant(0)},e.timeInterval=function(e){return I.hasOwnProperty(e)&&I[e]},e.utcInterval=function(e){return S.hasOwnProperty(e)&&S[e]},Object.defineProperty(e,"__esModule",{value:!0})}); |
export {default as scale} from './src/scales'; | ||
export {default as scheme} from './src/schemes'; | ||
export {default as bandSpace} from './src/bandSpace'; | ||
export { | ||
interpolate, | ||
interpolateRange, | ||
scaleFraction | ||
} from './src/interpolate'; | ||
export {interpolate, interpolateRange, scaleFraction} from './src/interpolate'; | ||
export {timeInterval, utcInterval} from './src/timeInterval'; |
{ | ||
"name": "vega-scale", | ||
"version": "2.0.2", | ||
"version": "2.1.0", | ||
"description": "Scales and color schemes for visual encoding.", | ||
@@ -25,3 +25,3 @@ "keywords": [ | ||
"build": "npm run test && uglifyjs build/vega-scale.js -c -m -o build/vega-scale.min.js", | ||
"pretest": "rm -rf build && mkdir build && rollup -g d3-array:d3,d3-interpolate:d3,d3-scale:d3,d3-scale-chromatic:d3,vega-util:vega -f umd -n vega -o build/vega-scale.js -- index.js", | ||
"pretest": "rm -rf build && mkdir build && rollup -g d3-array:d3,d3-interpolate:d3,d3-scale:d3,d3-scale-chromatic:d3,d3-time:d3,vega-util:vega -f umd -n vega -o build/vega-scale.js -- index.js", | ||
"test": "tape 'test/**/*-test.js' && eslint index.js src test", | ||
@@ -36,2 +36,3 @@ "prepublish": "npm run build", | ||
"d3-scale-chromatic": "^1.1", | ||
"d3-time": "1", | ||
"vega-util": "1" | ||
@@ -38,0 +39,0 @@ }, |
@@ -118,1 +118,19 @@ # vega-scale | ||
``` | ||
<a name="timeInterval" href="#timeInterval">#</a> | ||
vega.<b>timeInterval</b>(<i>unit</i>) | ||
[<>](https://github.com/vega/vega-scale/blob/master/src/timeInterval.js "Source") | ||
Given a string _unit_, return a corresponding | ||
[D3 time interval](https://github.com/d3/d3-time#_interval) function. | ||
Valid _unit_ strings are: `"millisecond"`, `"second"`, `"minute"`, `"hour"`, | ||
`"day"`, `"week"`, `"month"`, and `"year"`. | ||
<a name="utcInterval" href="#utcInterval">#</a> | ||
vega.<b>utcInterval</b>(<i>unit</i>) | ||
[<>](https://github.com/vega/vega-scale/blob/master/src/timeInterval.js "Source") | ||
Given a string _unit_, return a corresponding UTC-variant of a | ||
[D3 time interval](https://github.com/d3/d3-time#_interval) function. | ||
Valid _unit_ strings are: `"millisecond"`, `"second"`, `"minute"`, `"hour"`, | ||
`"day"`, `"week"`, `"month"`, and `"year"`. |
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
47631
19
1095
136
6
+ Addedd3-time@1