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

recharts-scale

Package Overview
Dependencies
Maintainers
2
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

recharts-scale - npm Package Compare versions

Comparing version 0.2.3 to 0.3.0

6

CHANGELOG.md

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

## 0.3.0 (Mar 01, 2017)
### feat
- Add new ticks function `getTickValuesFixedDomain`
## 0.2.3 (Feb 28, 2017)

@@ -2,0 +8,0 @@

31

es6/getNiceTickValues.js

@@ -6,3 +6,3 @@ 'use strict';

});
exports.getTickValues = exports.getNiceTickValues = undefined;
exports.getTickValuesFixedDomain = exports.getTickValues = exports.getNiceTickValues = undefined;

@@ -23,2 +23,4 @@ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); /**

function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
/**

@@ -234,3 +236,28 @@ * Calculate a interval of a minimum value and a maximum value

function getTickValuesFixedDomainFn(_ref7, tickCount) {
var _ref8 = _slicedToArray(_ref7, 2),
min = _ref8[0],
max = _ref8[1];
var allowDecimals = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
// More than two ticks should be return
var _getValidInterval5 = getValidInterval([min, max]),
_getValidInterval6 = _slicedToArray(_getValidInterval5, 2),
cormin = _getValidInterval6[0],
cormax = _getValidInterval6[1];
if (cormin === cormax) {
return [cormin];
}
var count = Math.max(tickCount, 2);
var step = getFormatStep((cormax - cormin) / (count - 1), allowDecimals, 0);
var values = [].concat(_toConsumableArray(_arithmetic2.default.rangeStep(cormin, cormax - 0.99 * step, step)), [cormax]);
return min > max ? (0, _utils.reverse)(values) : values;
}
var getNiceTickValues = exports.getNiceTickValues = (0, _utils.memoize)(getNiceTickValuesFn);
var getTickValues = exports.getTickValues = (0, _utils.memoize)(getTickValuesFn);
var getTickValues = exports.getTickValues = (0, _utils.memoize)(getTickValuesFn);
var getTickValuesFixedDomain = exports.getTickValuesFixedDomain = (0, _utils.memoize)(getTickValuesFixedDomainFn);

@@ -20,2 +20,8 @@ 'use strict';

}
});
Object.defineProperty(exports, 'getTickValuesFixedDomain', {
enumerable: true,
get: function get() {
return _getNiceTickValues.getTickValuesFixedDomain;
}
});

1

es6/util/arithmetic.js

@@ -119,3 +119,2 @@ 'use strict';

var sign = a >= 0 ? 1 : -1;
var cnt = Math.floor(a / mod);

@@ -122,0 +121,0 @@

@@ -6,3 +6,3 @@ 'use strict';

});
exports.getTickValues = exports.getNiceTickValues = undefined;
exports.getTickValuesFixedDomain = exports.getTickValues = exports.getNiceTickValues = undefined;

@@ -23,2 +23,4 @@ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); /**

function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
/**

@@ -234,3 +236,28 @@ * Calculate a interval of a minimum value and a maximum value

function getTickValuesFixedDomainFn(_ref7, tickCount) {
var _ref8 = _slicedToArray(_ref7, 2),
min = _ref8[0],
max = _ref8[1];
var allowDecimals = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
// More than two ticks should be return
var _getValidInterval5 = getValidInterval([min, max]),
_getValidInterval6 = _slicedToArray(_getValidInterval5, 2),
cormin = _getValidInterval6[0],
cormax = _getValidInterval6[1];
if (cormin === cormax) {
return [cormin];
}
var count = Math.max(tickCount, 2);
var step = getFormatStep((cormax - cormin) / (count - 1), allowDecimals, 0);
var values = [].concat(_toConsumableArray(_arithmetic2.default.rangeStep(cormin, cormax - 0.99 * step, step)), [cormax]);
return min > max ? (0, _utils.reverse)(values) : values;
}
var getNiceTickValues = exports.getNiceTickValues = (0, _utils.memoize)(getNiceTickValuesFn);
var getTickValues = exports.getTickValues = (0, _utils.memoize)(getTickValuesFn);
var getTickValues = exports.getTickValues = (0, _utils.memoize)(getTickValuesFn);
var getTickValuesFixedDomain = exports.getTickValuesFixedDomain = (0, _utils.memoize)(getTickValuesFixedDomainFn);

@@ -20,2 +20,8 @@ 'use strict';

}
});
Object.defineProperty(exports, 'getTickValuesFixedDomain', {
enumerable: true,
get: function get() {
return _getNiceTickValues.getTickValuesFixedDomain;
}
});

@@ -119,3 +119,2 @@ 'use strict';

var sign = a >= 0 ? 1 : -1;
var cnt = Math.floor(a / mod);

@@ -122,0 +121,0 @@

{
"name": "recharts-scale",
"version": "0.2.3",
"version": "0.3.0",
"description": "Scale of Cartesian Coordinates",

@@ -5,0 +5,0 @@ "main": "lib/index",

@@ -185,3 +185,18 @@ /**

function getTickValuesFixedDomainFn([min, max], tickCount, allowDecimals = true) {
// More than two ticks should be return
const [cormin, cormax] = getValidInterval([min, max]);
if (cormin === cormax) { return [cormin]; }
const count = Math.max(tickCount, 2);
const step = getFormatStep((cormax - cormin) / (count - 1), allowDecimals, 0);
const values = [...Arithmetic.rangeStep(cormin, cormax - 0.99 * step, step), cormax];
return min > max ? reverse(values) : values;
}
export const getNiceTickValues = memoize(getNiceTickValuesFn);
export const getTickValues = memoize(getTickValuesFn);
export const getTickValuesFixedDomain = memoize(getTickValuesFixedDomainFn);

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

export { getTickValues, getNiceTickValues } from './getNiceTickValues';
export { getTickValues, getNiceTickValues, getTickValuesFixedDomain } from './getNiceTickValues';

@@ -77,2 +77,8 @@ (function webpackUniversalModuleDefinition(root, factory) {

});
Object.defineProperty(exports, 'getTickValuesFixedDomain', {
enumerable: true,
get: function get() {
return _getNiceTickValues.getTickValuesFixedDomain;
}
});

@@ -230,3 +236,3 @@ /***/ },

});
exports.getTickValues = exports.getNiceTickValues = undefined;
exports.getTickValuesFixedDomain = exports.getTickValues = exports.getNiceTickValues = undefined;

@@ -247,2 +253,4 @@ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); /**

function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
/**

@@ -458,4 +466,29 @@ * Calculate a interval of a minimum value and a maximum value

function getTickValuesFixedDomainFn(_ref7, tickCount) {
var _ref8 = _slicedToArray(_ref7, 2),
min = _ref8[0],
max = _ref8[1];
var allowDecimals = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
// More than two ticks should be return
var _getValidInterval5 = getValidInterval([min, max]),
_getValidInterval6 = _slicedToArray(_getValidInterval5, 2),
cormin = _getValidInterval6[0],
cormax = _getValidInterval6[1];
if (cormin === cormax) {
return [cormin];
}
var count = Math.max(tickCount, 2);
var step = getFormatStep((cormax - cormin) / (count - 1), allowDecimals, 0);
var values = [].concat(_toConsumableArray(_arithmetic2.default.rangeStep(cormin, cormax - 0.99 * step, step)), [cormax]);
return min > max ? (0, _utils.reverse)(values) : values;
}
var getNiceTickValues = exports.getNiceTickValues = (0, _utils.memoize)(getNiceTickValuesFn);
var getTickValues = exports.getTickValues = (0, _utils.memoize)(getTickValuesFn);
var getTickValuesFixedDomain = exports.getTickValuesFixedDomain = (0, _utils.memoize)(getTickValuesFixedDomainFn);

@@ -584,3 +617,2 @@ /***/ },

var sign = a >= 0 ? 1 : -1;
var cnt = Math.floor(a / mod);

@@ -587,0 +619,0 @@

@@ -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},a=function(t){return t===u},i=function(t){return function e(){return 0===arguments.length||1===arguments.length&&a(arguments.length<=0?void 0:arguments[0])?e:t.apply(void 0,arguments)}},o=function t(e,n){return 1===e?n:i(function(){for(var o=arguments.length,l=Array(o),f=0;f<o;f++)l[f]=arguments[f];var c=l.filter(function(t){return t!==u}).length;return c>=e?n.apply(void 0,l):t(e-c,i(function(){for(var t=arguments.length,e=Array(t),u=0;u<t;u++)e[u]=arguments[u];var i=l.map(function(t){return a(t)?e.shift():t});return n.apply(void 0,r(i).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(),a=u[0],i=u.slice(1);return function(){return i.reduce(function(t,e){return e(t)},a.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),a=0;a<n;a++)u[a]=arguments[a];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=c(t,2),r=e[0],n=e[1],u=r,a=n;return r>n&&(u=n,a=r),[u,a]}function a(t,e,r){if(t<=0)return 0;var n=v.default.getDigitCount(t),u=t/Math.pow(10,n),a=1!==n?v.default.multiply(Math.ceil(u/.05)+r,.05):v.default.multiply(Math.ceil(u/.1)+r,.1),i=v.default.multiply(a,Math.pow(10,n));return e?i:Math.ceil(i)}function i(t,e,r){var n=v.default.isFloat(t),u=1,a=t;if(n&&r){var i=Math.abs(t);i<1?(u=Math.pow(10,v.default.getDigitCount(t)-1),a=v.default.multiply(Math.floor(t/u),u)):i>1&&(a=Math.floor(t))}else 0===t?a=Math.floor((e-1)/2):r||(a=Math.floor(t));var o=Math.floor((e-1)/2),l=(0,s.compose)((0,s.map)(function(t){return v.default.sum(a,v.default.multiply(t-o,u))}),s.range);return l(0,e)}function o(t,e,r,n){var u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,i=a((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,v.default.modulo(l,i)));var f=Math.ceil((l-t)/i),c=Math.ceil((e-l)/i),s=f+c+1;return s>r?o(t,e,r,n,u+1):(s<r&&(c=e>0?c+(r-s):c,f=e>0?f:f+(r-s)),{step:i,tickMin:v.default.minus(l,v.default.multiply(f,i)),tickMax:v.default.sum(l,v.default.multiply(c,i))})}function l(t){var e=c(t,2),r=e[0],n=e[1],a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,l=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],f=Math.max(a,2),p=u([r,n]),d=c(p,2),h=d[0],m=d[1];if(h===m)return i(h,a,l);var y=o(h,m,f,l),g=y.step,M=y.tickMin,b=y.tickMax,x=v.default.rangeStep(M,b+.1*g,g);return r>n?(0,s.reverse)(x):x}function f(t){var e=c(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],f=Math.max(o,2),p=u([r,n]),v=c(p,2),d=v[0],h=v[1];if(d===h)return i(d,o,l);var m=a((h-d)/(f-1),l,0),y=(0,s.compose)((0,s.map)(function(t){return d+t*m}),s.range),g=y(0,f).filter(function(t){return t>=d&&t<=h});return r>n?(0,s.reverse)(g):g}Object.defineProperty(e,"__esModule",{value:!0}),e.getTickValues=e.getNiceTickValues=void 0;var c=function(){function t(t,e){var r=[],n=!0,u=!1,a=void 0;try{for(var i,o=t[Symbol.iterator]();!(n=(i=o.next()).done)&&(r.push(i.value),!e||r.length!==e);n=!0);}catch(t){u=!0,a=t}finally{try{!n&&o.return&&o.return()}finally{if(u)throw a}}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")}}(),s=r(1),p=r(3),v=n(p);e.getNiceTickValues=(0,s.memoize)(l),e.getTickValues=(0,s.memoize)(f)},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 a(t){var e=t?""+t:"",r=e.split(".");return r.length>1?r[1].length:0}function i(t,e){var r=parseInt((""+t).replace(".",""),10),n=parseInt((""+e).replace(".",""),10),u=a(t)+a(e);return r*n/Math.pow(10,u)}function o(t,e){var r=Math.max(a(t),a(e));return r=Math.pow(10,r),(i(t,r)+i(e,r))/r}function l(t,e){return o(t,-e)}function f(t,e){var r=a(t),n=a(e),u=parseInt((""+t).replace(".",""),10),i=parseInt((""+e).replace(".",""),10);return u/i*Math.pow(10,n-r)}function c(t,e){var r=Math.abs(e);if(e<=0)return t;var n=Math.floor(t/r);return l(t,i(r,n))}function s(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),v=(0,p.curry)(function(t,e,r){var n=+t,u=+e;return n+r*(u-n)}),d=(0,p.curry)(function(t,e,r){var n=e-+t;return n=n||1/0,(r-t)/n}),h=(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:s,isFloat:n,getDigitCount:u,getDecimalDigitCount:a,sum:o,minus:l,multiply:i,divide:f,modulo:c,interpolateNumber:v,uninterpolateNumber:d,uninterpolateTruncation:h}}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.RechartsScale=t():e.RechartsScale=t()}(this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var u=r[n]={exports:{},id:n,loaded:!1};return e[n].call(u.exports,u,u.exports,t),u.loaded=!0,u.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2);Object.defineProperty(t,"getTickValues",{enumerable:!0,get:function(){return n.getTickValues}}),Object.defineProperty(t,"getNiceTickValues",{enumerable:!0,get:function(){return n.getNiceTickValues}}),Object.defineProperty(t,"getTickValuesFixedDomain",{enumerable:!0,get:function(){return n.getTickValuesFixedDomain}})},function(e,t){"use strict";function r(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return e},u=t.PLACE_HOLDER={"@@functional/placeholder":!0},a=function(e){return e===u},i=function(e){return function t(){return 0===arguments.length||1===arguments.length&&a(arguments.length<=0?void 0:arguments[0])?t:e.apply(void 0,arguments)}},o=function e(t,n){return 1===t?n:i(function(){for(var o=arguments.length,l=Array(o),f=0;f<o;f++)l[f]=arguments[f];var c=l.filter(function(e){return e!==u}).length;return c>=t?n.apply(void 0,l):e(t-c,i(function(){for(var e=arguments.length,t=Array(e),u=0;u<e;u++)t[u]=arguments[u];var i=l.map(function(e){return a(e)?t.shift():e});return n.apply(void 0,r(i).concat(t))}))})},l=t.curry=function(e){return o(e.length,e)};t.range=function(e,t){for(var r=[],n=e;n<t;++n)r[n-e]=n;return r},t.map=l(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(e){return t[e]}).map(e)}),t.compose=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(!t.length)return n;var u=t.reverse(),a=u[0],i=u.slice(1);return function(){return i.reduce(function(e,t){return t(e)},a.apply(void 0,arguments))}},t.reverse=function(e){return Array.isArray(e)?e.reverse():e.split("").reverse.join("")},t.memoize=function(e){var t=null,r=null;return function(){for(var n=arguments.length,u=Array(n),a=0;a<n;a++)u[a]=arguments[a];return t&&u.every(function(e,r){return e===t[r]})?r:(t=u,r=e.apply(void 0,u))}}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function u(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function a(e){var t=p(e,2),r=t[0],n=t[1],u=r,a=n;return r>n&&(u=n,a=r),[u,a]}function i(e,t,r){if(e<=0)return 0;var n=h.default.getDigitCount(e),u=e/Math.pow(10,n),a=1!==n?h.default.multiply(Math.ceil(u/.05)+r,.05):h.default.multiply(Math.ceil(u/.1)+r,.1),i=h.default.multiply(a,Math.pow(10,n));return t?i:Math.ceil(i)}function o(e,t,r){var n=h.default.isFloat(e),u=1,a=e;if(n&&r){var i=Math.abs(e);i<1?(u=Math.pow(10,h.default.getDigitCount(e)-1),a=h.default.multiply(Math.floor(e/u),u)):i>1&&(a=Math.floor(e))}else 0===e?a=Math.floor((t-1)/2):r||(a=Math.floor(e));var o=Math.floor((t-1)/2),l=(0,d.compose)((0,d.map)(function(e){return h.default.sum(a,h.default.multiply(e-o,u))}),d.range);return l(0,t)}function l(e,t,r,n){var u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=i((t-e)/(r-1),n,u),o=void 0;e<=0&&t>=0?o=0:(o=h.default.divide(h.default.sum(e,t),2),o=h.default.minus(o,h.default.modulo(o,a)));var f=Math.ceil((o-e)/a),c=Math.ceil((t-o)/a),s=f+c+1;return s>r?l(e,t,r,n,u+1):(s<r&&(c=t>0?c+(r-s):c,f=t>0?f:f+(r-s)),{step:a,tickMin:h.default.minus(o,h.default.multiply(f,a)),tickMax:h.default.sum(o,h.default.multiply(c,a))})}function f(e){var t=p(e,2),r=t[0],n=t[1],u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],f=Math.max(u,2),c=a([r,n]),s=p(c,2),v=s[0],m=s[1];if(v===m)return o(v,u,i);var g=l(v,m,f,i),y=g.step,M=g.tickMin,b=g.tickMax,x=h.default.rangeStep(M,b+.1*y,y);return r>n?(0,d.reverse)(x):x}function c(e){var t=p(e,2),r=t[0],n=t[1],u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,l=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],f=Math.max(u,2),c=a([r,n]),s=p(c,2),v=s[0],h=s[1];if(v===h)return o(v,u,l);var m=i((h-v)/(f-1),l,0),g=(0,d.compose)((0,d.map)(function(e){return v+e*m}),d.range),y=g(0,f).filter(function(e){return e>=v&&e<=h});return r>n?(0,d.reverse)(y):y}function s(e,t){var r=p(e,2),n=r[0],o=r[1],l=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],f=a([n,o]),c=p(f,2),s=c[0],v=c[1];if(s===v)return[s];var m=Math.max(t,2),g=i((v-s)/(m-1),l,0),y=[].concat(u(h.default.rangeStep(s,v-.99*g,g)),[v]);return n>o?(0,d.reverse)(y):y}Object.defineProperty(t,"__esModule",{value:!0}),t.getTickValuesFixedDomain=t.getTickValues=t.getNiceTickValues=void 0;var p=function(){function e(e,t){var r=[],n=!0,u=!1,a=void 0;try{for(var i,o=e[Symbol.iterator]();!(n=(i=o.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){u=!0,a=e}finally{try{!n&&o.return&&o.return()}finally{if(u)throw a}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),d=r(1),v=r(3),h=n(v);t.getNiceTickValues=(0,d.memoize)(f),t.getTickValues=(0,d.memoize)(c),t.getTickValuesFixedDomain=(0,d.memoize)(s)},function(e,t,r){"use strict";function n(e){return/^([+-]?)\d*\.\d+$/.test(e)}function u(e){var t=Math.abs(e),r=void 0;if(0===e)r=1;else if(t<1)r=Math.floor(Math.log(t)/Math.log(10))+1;else{var n=""+e,u=n.split(".");r=u[0].length}return r}function a(e){var t=e?""+e:"",r=t.split(".");return r.length>1?r[1].length:0}function i(e,t){var r=parseInt((""+e).replace(".",""),10),n=parseInt((""+t).replace(".",""),10),u=a(e)+a(t);return r*n/Math.pow(10,u)}function o(e,t){var r=Math.max(a(e),a(t));return r=Math.pow(10,r),(i(e,r)+i(t,r))/r}function l(e,t){return o(e,-t)}function f(e,t){var r=a(e),n=a(t),u=parseInt((""+e).replace(".",""),10),i=parseInt((""+t).replace(".",""),10);return u/i*Math.pow(10,n-r)}function c(e,t){var r=Math.abs(t);if(t<=0)return e;var n=Math.floor(e/r);return l(e,i(r,n))}function s(e,t,r){for(var n=e,u=[];n<t;)u.push(n),n=o(n,r);return u}Object.defineProperty(t,"__esModule",{value:!0});var p=r(1),d=(0,p.curry)(function(e,t,r){var n=+e,u=+t;return n+r*(u-n)}),v=(0,p.curry)(function(e,t,r){var n=t-+e;return n=n||1/0,(r-e)/n}),h=(0,p.curry)(function(e,t,r){var n=t-+e;return n=n||1/0,Math.max(0,Math.min(1,(r-e)/n))});t.default={rangeStep:s,isFloat:n,getDigitCount:u,getDecimalDigitCount:a,sum:o,minus:l,multiply:i,divide:f,modulo:c,interpolateNumber:d,uninterpolateNumber:v,uninterpolateTruncation:h}}])});
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