recharts-scale
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -30,8 +30,8 @@ 'use strict'; | ||
function getValidInterval(_ref) { | ||
var _ref2 = _slicedToArray(_ref, 2); | ||
var _ref2 = _slicedToArray(_ref, 2), | ||
min = _ref2[0], | ||
max = _ref2[1]; | ||
var min = _ref2[0]; | ||
var max = _ref2[1]; | ||
var validMin = min; | ||
var validMax = max; | ||
var validMin = min, | ||
validMax = max; | ||
@@ -126,3 +126,3 @@ // exchange | ||
function calculateStep(min, max, tickCount, allowDecimals) { | ||
var correctionFactor = arguments.length <= 4 || arguments[4] === undefined ? 0 : arguments[4]; | ||
var correctionFactor = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0; | ||
@@ -138,4 +138,4 @@ // The step which is easy to understand between two ticks | ||
} else { | ||
middle = (min + max) / 2; | ||
middle = middle - middle % step; | ||
middle = _arithmetic2.default.divide(_arithmetic2.default.sum(min, max), 2); | ||
middle = _arithmetic2.default.minus(middle, middle % step); | ||
} | ||
@@ -171,8 +171,8 @@ | ||
function getNiceTickValuesFn(_ref3) { | ||
var _ref4 = _slicedToArray(_ref3, 2); | ||
var _ref4 = _slicedToArray(_ref3, 2), | ||
min = _ref4[0], | ||
max = _ref4[1]; | ||
var min = _ref4[0]; | ||
var max = _ref4[1]; | ||
var tickCount = arguments.length <= 1 || arguments[1] === undefined ? 6 : arguments[1]; | ||
var allowDecimals = arguments.length <= 2 || arguments[2] === undefined ? true : arguments[2]; | ||
var tickCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6; | ||
var allowDecimals = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; | ||
@@ -182,10 +182,7 @@ // More than two ticks should be return | ||
var _getValidInterval = getValidInterval([min, max]); | ||
var _getValidInterval = getValidInterval([min, max]), | ||
_getValidInterval2 = _slicedToArray(_getValidInterval, 2), | ||
cormin = _getValidInterval2[0], | ||
cormax = _getValidInterval2[1]; | ||
var _getValidInterval2 = _slicedToArray(_getValidInterval, 2); | ||
var cormin = _getValidInterval2[0]; | ||
var cormax = _getValidInterval2[1]; | ||
if (cormin === cormax) { | ||
@@ -197,9 +194,7 @@ return getTickOfSingleValue(cormin, tickCount, allowDecimals); | ||
var _calculateStep = calculateStep(cormin, cormax, count, allowDecimals); | ||
var _calculateStep = calculateStep(cormin, cormax, count, allowDecimals), | ||
step = _calculateStep.step, | ||
tickMin = _calculateStep.tickMin, | ||
tickMax = _calculateStep.tickMax; | ||
var step = _calculateStep.step; | ||
var tickMin = _calculateStep.tickMin; | ||
var tickMax = _calculateStep.tickMax; | ||
var values = _arithmetic2.default.rangeStep(tickMin, tickMax + 0.1 * step, step); | ||
@@ -211,8 +206,8 @@ | ||
function getTickValuesFn(_ref5) { | ||
var _ref6 = _slicedToArray(_ref5, 2); | ||
var _ref6 = _slicedToArray(_ref5, 2), | ||
min = _ref6[0], | ||
max = _ref6[1]; | ||
var min = _ref6[0]; | ||
var max = _ref6[1]; | ||
var tickCount = arguments.length <= 1 || arguments[1] === undefined ? 6 : arguments[1]; | ||
var allowDecimals = arguments.length <= 2 || arguments[2] === undefined ? true : arguments[2]; | ||
var tickCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6; | ||
var allowDecimals = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; | ||
@@ -222,10 +217,7 @@ // More than two ticks should be return | ||
var _getValidInterval3 = getValidInterval([min, max]); | ||
var _getValidInterval3 = getValidInterval([min, max]), | ||
_getValidInterval4 = _slicedToArray(_getValidInterval3, 2), | ||
cormin = _getValidInterval4[0], | ||
cormax = _getValidInterval4[1]; | ||
var _getValidInterval4 = _slicedToArray(_getValidInterval3, 2); | ||
var cormin = _getValidInterval4[0]; | ||
var cormax = _getValidInterval4[1]; | ||
if (cormin === cormax) { | ||
@@ -232,0 +224,0 @@ return getTickOfSingleValue(cormin, tickCount, allowDecimals); |
@@ -30,8 +30,8 @@ 'use strict'; | ||
function getValidInterval(_ref) { | ||
var _ref2 = _slicedToArray(_ref, 2); | ||
var _ref2 = _slicedToArray(_ref, 2), | ||
min = _ref2[0], | ||
max = _ref2[1]; | ||
var min = _ref2[0]; | ||
var max = _ref2[1]; | ||
var validMin = min; | ||
var validMax = max; | ||
var validMin = min, | ||
validMax = max; | ||
@@ -126,3 +126,3 @@ // exchange | ||
function calculateStep(min, max, tickCount, allowDecimals) { | ||
var correctionFactor = arguments.length <= 4 || arguments[4] === undefined ? 0 : arguments[4]; | ||
var correctionFactor = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0; | ||
@@ -138,4 +138,4 @@ // The step which is easy to understand between two ticks | ||
} else { | ||
middle = (min + max) / 2; | ||
middle = middle - middle % step; | ||
middle = _arithmetic2.default.divide(_arithmetic2.default.sum(min, max), 2); | ||
middle = _arithmetic2.default.minus(middle, middle % step); | ||
} | ||
@@ -171,8 +171,8 @@ | ||
function getNiceTickValuesFn(_ref3) { | ||
var _ref4 = _slicedToArray(_ref3, 2); | ||
var _ref4 = _slicedToArray(_ref3, 2), | ||
min = _ref4[0], | ||
max = _ref4[1]; | ||
var min = _ref4[0]; | ||
var max = _ref4[1]; | ||
var tickCount = arguments.length <= 1 || arguments[1] === undefined ? 6 : arguments[1]; | ||
var allowDecimals = arguments.length <= 2 || arguments[2] === undefined ? true : arguments[2]; | ||
var tickCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6; | ||
var allowDecimals = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; | ||
@@ -182,10 +182,7 @@ // More than two ticks should be return | ||
var _getValidInterval = getValidInterval([min, max]); | ||
var _getValidInterval = getValidInterval([min, max]), | ||
_getValidInterval2 = _slicedToArray(_getValidInterval, 2), | ||
cormin = _getValidInterval2[0], | ||
cormax = _getValidInterval2[1]; | ||
var _getValidInterval2 = _slicedToArray(_getValidInterval, 2); | ||
var cormin = _getValidInterval2[0]; | ||
var cormax = _getValidInterval2[1]; | ||
if (cormin === cormax) { | ||
@@ -197,9 +194,7 @@ return getTickOfSingleValue(cormin, tickCount, allowDecimals); | ||
var _calculateStep = calculateStep(cormin, cormax, count, allowDecimals); | ||
var _calculateStep = calculateStep(cormin, cormax, count, allowDecimals), | ||
step = _calculateStep.step, | ||
tickMin = _calculateStep.tickMin, | ||
tickMax = _calculateStep.tickMax; | ||
var step = _calculateStep.step; | ||
var tickMin = _calculateStep.tickMin; | ||
var tickMax = _calculateStep.tickMax; | ||
var values = _arithmetic2.default.rangeStep(tickMin, tickMax + 0.1 * step, step); | ||
@@ -211,8 +206,8 @@ | ||
function getTickValuesFn(_ref5) { | ||
var _ref6 = _slicedToArray(_ref5, 2); | ||
var _ref6 = _slicedToArray(_ref5, 2), | ||
min = _ref6[0], | ||
max = _ref6[1]; | ||
var min = _ref6[0]; | ||
var max = _ref6[1]; | ||
var tickCount = arguments.length <= 1 || arguments[1] === undefined ? 6 : arguments[1]; | ||
var allowDecimals = arguments.length <= 2 || arguments[2] === undefined ? true : arguments[2]; | ||
var tickCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6; | ||
var allowDecimals = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; | ||
@@ -222,10 +217,7 @@ // More than two ticks should be return | ||
var _getValidInterval3 = getValidInterval([min, max]); | ||
var _getValidInterval3 = getValidInterval([min, max]), | ||
_getValidInterval4 = _slicedToArray(_getValidInterval3, 2), | ||
cormin = _getValidInterval4[0], | ||
cormax = _getValidInterval4[1]; | ||
var _getValidInterval4 = _slicedToArray(_getValidInterval3, 2); | ||
var cormin = _getValidInterval4[0]; | ||
var cormax = _getValidInterval4[1]; | ||
if (cormin === cormax) { | ||
@@ -232,0 +224,0 @@ return getTickOfSingleValue(cormin, tickCount, allowDecimals); |
{ | ||
"name": "recharts-scale", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Scale of Cartesian Coordinates", | ||
@@ -5,0 +5,0 @@ "main": "lib/index", |
@@ -116,4 +116,4 @@ /** | ||
} else { | ||
middle = (min + max) / 2; | ||
middle = middle - middle % step; | ||
middle = Arithmetic.divide(Arithmetic.sum(min, max), 2); | ||
middle = Arithmetic.minus(middle, middle % step); | ||
} | ||
@@ -120,0 +120,0 @@ |
@@ -253,8 +253,8 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
function getValidInterval(_ref) { | ||
var _ref2 = _slicedToArray(_ref, 2); | ||
var _ref2 = _slicedToArray(_ref, 2), | ||
min = _ref2[0], | ||
max = _ref2[1]; | ||
var min = _ref2[0]; | ||
var max = _ref2[1]; | ||
var validMin = min; | ||
var validMax = max; | ||
var validMin = min, | ||
validMax = max; | ||
@@ -349,3 +349,3 @@ // exchange | ||
function calculateStep(min, max, tickCount, allowDecimals) { | ||
var correctionFactor = arguments.length <= 4 || arguments[4] === undefined ? 0 : arguments[4]; | ||
var correctionFactor = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0; | ||
@@ -361,4 +361,4 @@ // The step which is easy to understand between two ticks | ||
} else { | ||
middle = (min + max) / 2; | ||
middle = middle - middle % step; | ||
middle = _arithmetic2.default.divide(_arithmetic2.default.sum(min, max), 2); | ||
middle = _arithmetic2.default.minus(middle, middle % step); | ||
} | ||
@@ -394,8 +394,8 @@ | ||
function getNiceTickValuesFn(_ref3) { | ||
var _ref4 = _slicedToArray(_ref3, 2); | ||
var _ref4 = _slicedToArray(_ref3, 2), | ||
min = _ref4[0], | ||
max = _ref4[1]; | ||
var min = _ref4[0]; | ||
var max = _ref4[1]; | ||
var tickCount = arguments.length <= 1 || arguments[1] === undefined ? 6 : arguments[1]; | ||
var allowDecimals = arguments.length <= 2 || arguments[2] === undefined ? true : arguments[2]; | ||
var tickCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6; | ||
var allowDecimals = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; | ||
@@ -405,10 +405,7 @@ // More than two ticks should be return | ||
var _getValidInterval = getValidInterval([min, max]); | ||
var _getValidInterval = getValidInterval([min, max]), | ||
_getValidInterval2 = _slicedToArray(_getValidInterval, 2), | ||
cormin = _getValidInterval2[0], | ||
cormax = _getValidInterval2[1]; | ||
var _getValidInterval2 = _slicedToArray(_getValidInterval, 2); | ||
var cormin = _getValidInterval2[0]; | ||
var cormax = _getValidInterval2[1]; | ||
if (cormin === cormax) { | ||
@@ -420,9 +417,7 @@ return getTickOfSingleValue(cormin, tickCount, allowDecimals); | ||
var _calculateStep = calculateStep(cormin, cormax, count, allowDecimals); | ||
var _calculateStep = calculateStep(cormin, cormax, count, allowDecimals), | ||
step = _calculateStep.step, | ||
tickMin = _calculateStep.tickMin, | ||
tickMax = _calculateStep.tickMax; | ||
var step = _calculateStep.step; | ||
var tickMin = _calculateStep.tickMin; | ||
var tickMax = _calculateStep.tickMax; | ||
var values = _arithmetic2.default.rangeStep(tickMin, tickMax + 0.1 * step, step); | ||
@@ -434,8 +429,8 @@ | ||
function getTickValuesFn(_ref5) { | ||
var _ref6 = _slicedToArray(_ref5, 2); | ||
var _ref6 = _slicedToArray(_ref5, 2), | ||
min = _ref6[0], | ||
max = _ref6[1]; | ||
var min = _ref6[0]; | ||
var max = _ref6[1]; | ||
var tickCount = arguments.length <= 1 || arguments[1] === undefined ? 6 : arguments[1]; | ||
var allowDecimals = arguments.length <= 2 || arguments[2] === undefined ? true : arguments[2]; | ||
var tickCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 6; | ||
var allowDecimals = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; | ||
@@ -445,10 +440,7 @@ // More than two ticks should be return | ||
var _getValidInterval3 = getValidInterval([min, max]); | ||
var _getValidInterval3 = getValidInterval([min, max]), | ||
_getValidInterval4 = _slicedToArray(_getValidInterval3, 2), | ||
cormin = _getValidInterval4[0], | ||
cormax = _getValidInterval4[1]; | ||
var _getValidInterval4 = _slicedToArray(_getValidInterval3, 2); | ||
var cormin = _getValidInterval4[0]; | ||
var cormax = _getValidInterval4[1]; | ||
if (cormin === cormax) { | ||
@@ -455,0 +447,0 @@ return getTickOfSingleValue(cormin, tickCount, allowDecimals); |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.RechartsScale=e():t.RechartsScale=e()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var u=r[n]={exports:{},id:n,loaded:!1};return t[n].call(u.exports,u,u.exports,e),u.loaded=!0,u.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(2);Object.defineProperty(e,"getTickValues",{enumerable:!0,get:function(){return n.getTickValues}}),Object.defineProperty(e,"getNiceTickValues",{enumerable:!0,get:function(){return n.getNiceTickValues}})},function(t,e){"use strict";function r(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}Object.defineProperty(e,"__esModule",{value:!0});var n=function(t){return t},u=e.PLACE_HOLDER={"@@functional/placeholder":!0},i=function(t){return t===u},a=function(t){return function e(){return 0===arguments.length||1===arguments.length&&i(arguments.length<=0?void 0:arguments[0])?e:t.apply(void 0,arguments)}},o=function c(t,e){return 1===t?e:a(function(){for(var n=arguments.length,o=Array(n),l=0;l<n;l++)o[l]=arguments[l];var f=o.filter(function(t){return t!==u}).length;return f>=t?e.apply(void 0,o):c(t-f,a(function(){for(var t=arguments.length,n=Array(t),u=0;u<t;u++)n[u]=arguments[u];var a=o.map(function(t){return i(t)?n.shift():t});return e.apply(void 0,r(a).concat(n))}))})},l=e.curry=function(t){return o(t.length,t)};e.range=function(t,e){for(var r=[],n=t;n<e;++n)r[n-t]=n;return r},e.map=l(function(t,e){return Array.isArray(e)?e.map(t):Object.keys(e).map(function(t){return e[t]}).map(t)}),e.compose=function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];if(!e.length)return n;var u=e.reverse(),i=u[0],a=u.slice(1);return function(){return a.reduce(function(t,e){return e(t)},i.apply(void 0,arguments))}},e.reverse=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},e.memoize=function(t){var e=null,r=null;return function(){for(var n=arguments.length,u=Array(n),i=0;i<n;i++)u[i]=arguments[i];return e&&u.every(function(t,r){return t===e[r]})?r:(e=u,r=t.apply(void 0,u))}}},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function u(t){var e=f(t,2),r=e[0],n=e[1],u=r,i=n;return r>n&&(u=n,i=r),[u,i]}function i(t,e,r){if(t<=0)return 0;var n=v["default"].getDigitCount(t),u=t/Math.pow(10,n),i=1!==n?v["default"].multiply(Math.ceil(u/.05)+r,.05):v["default"].multiply(Math.ceil(u/.1)+r,.1),a=v["default"].multiply(i,Math.pow(10,n));return e?a:Math.ceil(a)}function a(t,e,r){var n=v["default"].isFloat(t),u=1,i=t;if(n&&r){var a=Math.abs(t);a<1?(u=Math.pow(10,v["default"].getDigitCount(t)-1),i=v["default"].multiply(Math.floor(t/u),u)):a>1&&(i=Math.floor(t))}else 0===t?i=Math.floor((e-1)/2):r||(i=Math.floor(t));var o=Math.floor((e-1)/2),l=(0,p.compose)((0,p.map)(function(t){return v["default"].sum(i,v["default"].multiply(t-o,u))}),p.range);return l(0,e)}function o(t,e,r,n){var u=arguments.length<=4||void 0===arguments[4]?0:arguments[4],a=i((e-t)/(r-1),n,u),l=void 0;t<=0&&e>=0?l=0:(l=(t+e)/2,l-=l%a);var c=Math.ceil((l-t)/a),f=Math.ceil((e-l)/a),p=c+f+1;return p>r?o(t,e,r,n,u+1):(p<r&&(f=e>0?f+(r-p):f,c=e>0?c:c+(r-p)),{step:a,tickMin:v["default"].minus(l,v["default"].multiply(c,a)),tickMax:v["default"].sum(l,v["default"].multiply(f,a))})}function l(t){var e=f(t,2),r=e[0],n=e[1],i=arguments.length<=1||void 0===arguments[1]?6:arguments[1],l=arguments.length<=2||void 0===arguments[2]||arguments[2],c=Math.max(i,2),s=u([r,n]),d=f(s,2),h=d[0],y=d[1];if(h===y)return a(h,i,l);var m=o(h,y,c,l),g=m.step,M=m.tickMin,b=m.tickMax,x=v["default"].rangeStep(M,b+.1*g,g);return r>n?(0,p.reverse)(x):x}function c(t){var e=f(t,2),r=e[0],n=e[1],o=arguments.length<=1||void 0===arguments[1]?6:arguments[1],l=arguments.length<=2||void 0===arguments[2]||arguments[2],c=Math.max(o,2),s=u([r,n]),v=f(s,2),d=v[0],h=v[1];if(d===h)return a(d,o,l);var y=i((h-d)/(c-1),l,0),m=(0,p.compose)((0,p.map)(function(t){return d+t*y}),p.range),g=m(0,c).filter(function(t){return t>=d&&t<=h});return r>n?(0,p.reverse)(g):g}Object.defineProperty(e,"__esModule",{value:!0}),e.getTickValues=e.getNiceTickValues=void 0;var f=function(){function t(t,e){var r=[],n=!0,u=!1,i=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(l){u=!0,i=l}finally{try{!n&&o["return"]&&o["return"]()}finally{if(u)throw i}}return r}return function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=r(1),s=r(3),v=n(s);e.getNiceTickValues=(0,p.memoize)(l),e.getTickValues=(0,p.memoize)(c)},function(t,e,r){"use strict";function n(t){return/^([+-]?)\d*\.\d+$/.test(t)}function u(t){var e=Math.abs(t),r=void 0;if(0===t)r=1;else if(e<1)r=Math.floor(Math.log(e)/Math.log(10))+1;else{var n=""+t,u=n.split(".");r=u[0].length}return r}function i(t){var e=t?""+t:"",r=e.split(".");return r.length>1?r[1].length:0}function a(t,e){var r=parseInt((""+t).replace(".",""),10),n=parseInt((""+e).replace(".",""),10),u=i(t)+i(e);return r*n/Math.pow(10,u)}function o(t,e){var r=Math.max(i(t),i(e));return r=Math.pow(10,r),(a(t,r)+a(e,r))/r}function l(t,e){return o(t,-e)}function c(t,e){var r=i(t),n=i(e),u=parseInt((""+t).replace(".",""),10),a=parseInt((""+e).replace(".",""),10);return u/a*Math.pow(10,n-r)}function f(t,e,r){for(var n=t,u=[];n<e;)u.push(n),n=o(n,r);return u}Object.defineProperty(e,"__esModule",{value:!0});var p=r(1),s=(0,p.curry)(function(t,e,r){var n=+t,u=+e;return n+r*(u-n)}),v=(0,p.curry)(function(t,e,r){var n=e-+t;return n=n||1/0,(r-t)/n}),d=(0,p.curry)(function(t,e,r){var n=e-+t;return n=n||1/0,Math.max(0,Math.min(1,(r-t)/n))});e["default"]={rangeStep:f,isFloat:n,getDigitCount:u,getDecimalDigitCount:i,sum:o,minus:l,multiply:a,divide:c,interpolateNumber:s,uninterpolateNumber:v,uninterpolateTruncation:d}}])}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.RechartsScale=e():t.RechartsScale=e()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var u=r[n]={exports:{},id:n,loaded:!1};return t[n].call(u.exports,u,u.exports,e),u.loaded=!0,u.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(2);Object.defineProperty(e,"getTickValues",{enumerable:!0,get:function(){return n.getTickValues}}),Object.defineProperty(e,"getNiceTickValues",{enumerable:!0,get:function(){return n.getNiceTickValues}})},function(t,e){"use strict";function r(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)}Object.defineProperty(e,"__esModule",{value:!0});var n=function(t){return t},u=e.PLACE_HOLDER={"@@functional/placeholder":!0},i=function(t){return t===u},a=function(t){return function e(){return 0===arguments.length||1===arguments.length&&i(arguments.length<=0?void 0:arguments[0])?e:t.apply(void 0,arguments)}},o=function t(e,n){return 1===e?n:a(function(){for(var o=arguments.length,l=Array(o),c=0;c<o;c++)l[c]=arguments[c];var f=l.filter(function(t){return t!==u}).length;return f>=e?n.apply(void 0,l):t(e-f,a(function(){for(var t=arguments.length,e=Array(t),u=0;u<t;u++)e[u]=arguments[u];var a=l.map(function(t){return i(t)?e.shift():t});return n.apply(void 0,r(a).concat(e))}))})},l=e.curry=function(t){return o(t.length,t)};e.range=function(t,e){for(var r=[],n=t;n<e;++n)r[n-t]=n;return r},e.map=l(function(t,e){return Array.isArray(e)?e.map(t):Object.keys(e).map(function(t){return e[t]}).map(t)}),e.compose=function(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];if(!e.length)return n;var u=e.reverse(),i=u[0],a=u.slice(1);return function(){return a.reduce(function(t,e){return e(t)},i.apply(void 0,arguments))}},e.reverse=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},e.memoize=function(t){var e=null,r=null;return function(){for(var n=arguments.length,u=Array(n),i=0;i<n;i++)u[i]=arguments[i];return e&&u.every(function(t,r){return t===e[r]})?r:(e=u,r=t.apply(void 0,u))}}},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function u(t){var e=f(t,2),r=e[0],n=e[1],u=r,i=n;return r>n&&(u=n,i=r),[u,i]}function i(t,e,r){if(t<=0)return 0;var n=v.default.getDigitCount(t),u=t/Math.pow(10,n),i=1!==n?v.default.multiply(Math.ceil(u/.05)+r,.05):v.default.multiply(Math.ceil(u/.1)+r,.1),a=v.default.multiply(i,Math.pow(10,n));return e?a:Math.ceil(a)}function a(t,e,r){var n=v.default.isFloat(t),u=1,i=t;if(n&&r){var a=Math.abs(t);a<1?(u=Math.pow(10,v.default.getDigitCount(t)-1),i=v.default.multiply(Math.floor(t/u),u)):a>1&&(i=Math.floor(t))}else 0===t?i=Math.floor((e-1)/2):r||(i=Math.floor(t));var o=Math.floor((e-1)/2),l=(0,p.compose)((0,p.map)(function(t){return v.default.sum(i,v.default.multiply(t-o,u))}),p.range);return l(0,e)}function o(t,e,r,n){var u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=i((e-t)/(r-1),n,u),l=void 0;t<=0&&e>=0?l=0:(l=v.default.divide(v.default.sum(t,e),2),l=v.default.minus(l,l%a));var c=Math.ceil((l-t)/a),f=Math.ceil((e-l)/a),p=c+f+1;return p>r?o(t,e,r,n,u+1):(p<r&&(f=e>0?f+(r-p):f,c=e>0?c:c+(r-p)),{step:a,tickMin:v.default.minus(l,v.default.multiply(c,a)),tickMax:v.default.sum(l,v.default.multiply(f,a))})}function l(t){var e=f(t,2),r=e[0],n=e[1],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,l=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],c=Math.max(i,2),s=u([r,n]),d=f(s,2),h=d[0],y=d[1];if(h===y)return a(h,i,l);var m=o(h,y,c,l),g=m.step,M=m.tickMin,b=m.tickMax,x=v.default.rangeStep(M,b+.1*g,g);return r>n?(0,p.reverse)(x):x}function c(t){var e=f(t,2),r=e[0],n=e[1],o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,l=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],c=Math.max(o,2),s=u([r,n]),v=f(s,2),d=v[0],h=v[1];if(d===h)return a(d,o,l);var y=i((h-d)/(c-1),l,0),m=(0,p.compose)((0,p.map)(function(t){return d+t*y}),p.range),g=m(0,c).filter(function(t){return t>=d&&t<=h});return r>n?(0,p.reverse)(g):g}Object.defineProperty(e,"__esModule",{value:!0}),e.getTickValues=e.getNiceTickValues=void 0;var f=function(){function t(t,e){var r=[],n=!0,u=!1,i=void 0;try{for(var a,o=t[Symbol.iterator]();!(n=(a=o.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){u=!0,i=t}finally{try{!n&&o.return&&o.return()}finally{if(u)throw i}}return r}return function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),p=r(1),s=r(3),v=n(s);e.getNiceTickValues=(0,p.memoize)(l),e.getTickValues=(0,p.memoize)(c)},function(t,e,r){"use strict";function n(t){return/^([+-]?)\d*\.\d+$/.test(t)}function u(t){var e=Math.abs(t),r=void 0;if(0===t)r=1;else if(e<1)r=Math.floor(Math.log(e)/Math.log(10))+1;else{var n=""+t,u=n.split(".");r=u[0].length}return r}function i(t){var e=t?""+t:"",r=e.split(".");return r.length>1?r[1].length:0}function a(t,e){var r=parseInt((""+t).replace(".",""),10),n=parseInt((""+e).replace(".",""),10),u=i(t)+i(e);return r*n/Math.pow(10,u)}function o(t,e){var r=Math.max(i(t),i(e));return r=Math.pow(10,r),(a(t,r)+a(e,r))/r}function l(t,e){return o(t,-e)}function c(t,e){var r=i(t),n=i(e),u=parseInt((""+t).replace(".",""),10),a=parseInt((""+e).replace(".",""),10);return u/a*Math.pow(10,n-r)}function f(t,e,r){for(var n=t,u=[];n<e;)u.push(n),n=o(n,r);return u}Object.defineProperty(e,"__esModule",{value:!0});var p=r(1),s=(0,p.curry)(function(t,e,r){var n=+t,u=+e;return n+r*(u-n)}),v=(0,p.curry)(function(t,e,r){var n=e-+t;return n=n||1/0,(r-t)/n}),d=(0,p.curry)(function(t,e,r){var n=e-+t;return n=n||1/0,Math.max(0,Math.min(1,(r-t)/n))});e.default={rangeStep:f,isFloat:n,getDigitCount:u,getDecimalDigitCount:i,sum:o,minus:l,multiply:a,divide:c,interpolateNumber:s,uninterpolateNumber:v,uninterpolateTruncation:d}}])}); |
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
84563