recharts-scale
Advanced tools
Comparing version 0.1.9 to 0.1.10
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
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"); } }; }(); /** | ||
@@ -9,6 +13,2 @@ * @fileOverview calculate tick values of scale | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _utils = require('./util/utils'); | ||
@@ -124,3 +124,3 @@ | ||
// 计算刻度的一个中间值 | ||
var middle = undefined; | ||
var middle = void 0; | ||
@@ -157,4 +157,3 @@ // 当0属于取值范围时 | ||
* | ||
* @param {Number} min 最小值 | ||
* @param {Number} max 最大值 | ||
* @param {Number} min, max min: 最小值, max: 最大值 | ||
* @param {Integer} tickCount 刻度数 | ||
@@ -180,2 +179,3 @@ * @return {Array} 取刻度数组 | ||
if (cormin === cormax) { | ||
@@ -193,2 +193,3 @@ return getTickOfSingleValue(cormin, tickCount); | ||
var values = _arithmetic2.default.rangeStep(tickMin, tickMax + 0.1 * step, step); | ||
@@ -195,0 +196,0 @@ |
@@ -20,5 +20,5 @@ 'use strict'; | ||
tickCount = Math.max(tickCount, 2); | ||
var count = Math.max(tickCount, 2); | ||
var step = (domain[1] - domain[0]) / (tickCount - 1); | ||
var step = (domain[1] - domain[0]) / (count - 1); | ||
@@ -29,5 +29,5 @@ var fn = (0, _utils.compose)((0, _utils.map)(function (n) { | ||
return fn(0, tickCount); | ||
return fn(0, count); | ||
} | ||
exports.default = getTickValues; |
@@ -36,3 +36,3 @@ 'use strict'; | ||
var abs = Math.abs(value); | ||
var result = undefined; | ||
var result = void 0; | ||
@@ -64,2 +64,15 @@ if (value === 0) { | ||
/** | ||
* 乘法运算,解决了js运算的精度问题 | ||
* @param {Number} a 被乘数 | ||
* @param {Number} b 乘数 | ||
* @return {Number} 积 | ||
*/ | ||
function multiply(a, b) { | ||
var intA = parseInt(('' + a).replace('.', ''), 10); | ||
var intB = parseInt(('' + b).replace('.', ''), 10); | ||
var count = getDecimalDigitCount(a) + getDecimalDigitCount(b); | ||
return intA * intB / Math.pow(10, count); | ||
} | ||
/** | ||
* 加法运算,解决了js运算的精度问题 | ||
@@ -87,15 +100,2 @@ * @param {Number} a 被加数 | ||
/** | ||
* 乘法运算,解决了js运算的精度问题 | ||
* @param {Number} a 被乘数 | ||
* @param {Number} b 乘数 | ||
* @return {Number} 积 | ||
*/ | ||
function multiply(a, b) { | ||
var intA = parseInt(('' + a).replace('.', ''), 10); | ||
var intB = parseInt(('' + b).replace('.', ''), 10); | ||
var count = getDecimalDigitCount(a) + getDecimalDigitCount(b); | ||
return intA * intB / Math.pow(10, count); | ||
} | ||
/** | ||
* 除法运算,解决了js运算的精度问题 | ||
@@ -161,3 +161,3 @@ * @param {Number} a 被除数 | ||
diff = diff ? diff : Infinity; | ||
diff = diff || Infinity; | ||
@@ -178,3 +178,3 @@ return (x - a) / diff; | ||
diff = diff ? diff : Infinity; | ||
diff = diff || Infinity; | ||
@@ -181,0 +181,0 @@ return Math.max(0, Math.min(1, (x - a) / diff)); |
@@ -13,3 +13,3 @@ 'use strict'; | ||
var __ = exports.__ = { | ||
var PLACE_HOLDER = exports.PLACE_HOLDER = { | ||
'@@functional/placeholder': true | ||
@@ -19,6 +19,6 @@ }; | ||
var isPlaceHolder = function isPlaceHolder(val) { | ||
return val === __; | ||
return val === PLACE_HOLDER; | ||
}; | ||
var _curry0 = function _curry0(fn) { | ||
var curry0 = function curry0(fn) { | ||
return function _curried() { | ||
@@ -38,3 +38,3 @@ if (arguments.length === 0 || arguments.length === 1 && isPlaceHolder(arguments.length <= 0 ? undefined : arguments[0])) { | ||
return _curry0(function () { | ||
return curry0(function () { | ||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
@@ -45,3 +45,3 @@ args[_key] = arguments[_key]; | ||
var argsLength = args.filter(function (arg) { | ||
return arg !== __; | ||
return arg !== PLACE_HOLDER; | ||
}).length; | ||
@@ -53,3 +53,3 @@ | ||
return curryN(n - argsLength, _curry0(function () { | ||
return curryN(n - argsLength, curry0(function () { | ||
for (var _len2 = arguments.length, restArgs = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | ||
@@ -56,0 +56,0 @@ restArgs[_key2] = arguments[_key2]; |
@@ -0,1 +1,5 @@ | ||
0.1.10 / 2016-07-07 | ||
================== | ||
* deps: update deps and fix lint error | ||
0.1.9 / 2016-04-08 | ||
@@ -2,0 +6,0 @@ ================== |
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
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"); } }; }(); /** | ||
@@ -9,6 +13,2 @@ * @fileOverview calculate tick values of scale | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _utils = require('./util/utils'); | ||
@@ -124,3 +124,3 @@ | ||
// 计算刻度的一个中间值 | ||
var middle = undefined; | ||
var middle = void 0; | ||
@@ -157,4 +157,3 @@ // 当0属于取值范围时 | ||
* | ||
* @param {Number} min 最小值 | ||
* @param {Number} max 最大值 | ||
* @param {Number} min, max min: 最小值, max: 最大值 | ||
* @param {Integer} tickCount 刻度数 | ||
@@ -180,2 +179,3 @@ * @return {Array} 取刻度数组 | ||
if (cormin === cormax) { | ||
@@ -193,2 +193,3 @@ return getTickOfSingleValue(cormin, tickCount); | ||
var values = _arithmetic2.default.rangeStep(tickMin, tickMax + 0.1 * step, step); | ||
@@ -195,0 +196,0 @@ |
@@ -20,5 +20,5 @@ 'use strict'; | ||
tickCount = Math.max(tickCount, 2); | ||
var count = Math.max(tickCount, 2); | ||
var step = (domain[1] - domain[0]) / (tickCount - 1); | ||
var step = (domain[1] - domain[0]) / (count - 1); | ||
@@ -29,5 +29,5 @@ var fn = (0, _utils.compose)((0, _utils.map)(function (n) { | ||
return fn(0, tickCount); | ||
return fn(0, count); | ||
} | ||
exports.default = getTickValues; |
@@ -36,3 +36,3 @@ 'use strict'; | ||
var abs = Math.abs(value); | ||
var result = undefined; | ||
var result = void 0; | ||
@@ -64,2 +64,15 @@ if (value === 0) { | ||
/** | ||
* 乘法运算,解决了js运算的精度问题 | ||
* @param {Number} a 被乘数 | ||
* @param {Number} b 乘数 | ||
* @return {Number} 积 | ||
*/ | ||
function multiply(a, b) { | ||
var intA = parseInt(('' + a).replace('.', ''), 10); | ||
var intB = parseInt(('' + b).replace('.', ''), 10); | ||
var count = getDecimalDigitCount(a) + getDecimalDigitCount(b); | ||
return intA * intB / Math.pow(10, count); | ||
} | ||
/** | ||
* 加法运算,解决了js运算的精度问题 | ||
@@ -87,15 +100,2 @@ * @param {Number} a 被加数 | ||
/** | ||
* 乘法运算,解决了js运算的精度问题 | ||
* @param {Number} a 被乘数 | ||
* @param {Number} b 乘数 | ||
* @return {Number} 积 | ||
*/ | ||
function multiply(a, b) { | ||
var intA = parseInt(('' + a).replace('.', ''), 10); | ||
var intB = parseInt(('' + b).replace('.', ''), 10); | ||
var count = getDecimalDigitCount(a) + getDecimalDigitCount(b); | ||
return intA * intB / Math.pow(10, count); | ||
} | ||
/** | ||
* 除法运算,解决了js运算的精度问题 | ||
@@ -161,3 +161,3 @@ * @param {Number} a 被除数 | ||
diff = diff ? diff : Infinity; | ||
diff = diff || Infinity; | ||
@@ -178,3 +178,3 @@ return (x - a) / diff; | ||
diff = diff ? diff : Infinity; | ||
diff = diff || Infinity; | ||
@@ -181,0 +181,0 @@ return Math.max(0, Math.min(1, (x - a) / diff)); |
@@ -13,3 +13,3 @@ 'use strict'; | ||
var __ = exports.__ = { | ||
var PLACE_HOLDER = exports.PLACE_HOLDER = { | ||
'@@functional/placeholder': true | ||
@@ -19,6 +19,6 @@ }; | ||
var isPlaceHolder = function isPlaceHolder(val) { | ||
return val === __; | ||
return val === PLACE_HOLDER; | ||
}; | ||
var _curry0 = function _curry0(fn) { | ||
var curry0 = function curry0(fn) { | ||
return function _curried() { | ||
@@ -38,3 +38,3 @@ if (arguments.length === 0 || arguments.length === 1 && isPlaceHolder(arguments.length <= 0 ? undefined : arguments[0])) { | ||
return _curry0(function () { | ||
return curry0(function () { | ||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
@@ -45,3 +45,3 @@ args[_key] = arguments[_key]; | ||
var argsLength = args.filter(function (arg) { | ||
return arg !== __; | ||
return arg !== PLACE_HOLDER; | ||
}).length; | ||
@@ -53,3 +53,3 @@ | ||
return curryN(n - argsLength, _curry0(function () { | ||
return curryN(n - argsLength, curry0(function () { | ||
for (var _len2 = arguments.length, restArgs = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | ||
@@ -56,0 +56,0 @@ restArgs[_key2] = arguments[_key2]; |
{ | ||
"name": "recharts-scale", | ||
"version": "0.1.9", | ||
"version": "0.1.10", | ||
"description": "Scale of Cartesian Coordinates", | ||
@@ -19,2 +19,5 @@ "main": "lib/index", | ||
], | ||
"pre-commit": [ | ||
"lint" | ||
], | ||
"repository": { | ||
@@ -30,16 +33,19 @@ "type": "git", | ||
"devDependencies": { | ||
"babel-cli": "^6.4.5", | ||
"babel-eslint": "5.0.0-beta6", | ||
"babel-loader": "^6.2.2", | ||
"babel-plugin-transform-export-extensions": "6.3.13", | ||
"babel-preset-es2015": "6.3.13", | ||
"babel-cli": "^6.10.0", | ||
"babel-eslint": "^6.1.0", | ||
"babel-loader": "^6.2.4", | ||
"babel-plugin-transform-export-extensions": "^6.8.0", | ||
"babel-preset-es2015": "^6.9.0", | ||
"babel-preset-stage-0": "6.3.13", | ||
"babel-register": "^6.3.13", | ||
"chai": "3.4.1", | ||
"eslint": "1.10.3", | ||
"eslint-config-airbnb": "2.1.1", | ||
"eslint-plugin-react": "3.13.0", | ||
"isparta": "4.0.0", | ||
"mocha": "2.3.4", | ||
"webpack": "^1.12.12" | ||
"eslint": "^2.9.0", | ||
"eslint-plugin-import": "^1.7.0", | ||
"eslint-plugin-jsx-a11y": "^1.5.0", | ||
"eslint-config-airbnb": "^9.0.1", | ||
"eslint-plugin-react": "^5.2.0", | ||
"isparta": "^4.0.0", | ||
"mocha": "^2.5.0", | ||
"webpack": "^1.13.1", | ||
"pre-commit": "^1.1.3" | ||
}, | ||
@@ -46,0 +52,0 @@ "scripts": { |
@@ -82,3 +82,3 @@ /** | ||
const fn = compose( | ||
map(n => { return Arithmetic.sum(middle, Arithmetic.multiply(n - middleIndex, step)); }), | ||
map(n => Arithmetic.sum(middle, Arithmetic.multiply(n - middleIndex, step))), | ||
range | ||
@@ -135,4 +135,3 @@ ); | ||
* | ||
* @param {Number} min 最小值 | ||
* @param {Number} max 最大值 | ||
* @param {Number} min, max min: 最小值, max: 最大值 | ||
* @param {Integer} tickCount 刻度数 | ||
@@ -139,0 +138,0 @@ * @return {Array} 取刻度数组 |
@@ -9,5 +9,5 @@ import { compose, map, range } from './util/utils'; | ||
tickCount = Math.max(tickCount, 2); | ||
const count = Math.max(tickCount, 2); | ||
const step = (domain[1] - domain[0]) / (tickCount - 1); | ||
const step = (domain[1] - domain[0]) / (count - 1); | ||
@@ -19,5 +19,5 @@ const fn = compose( | ||
return fn(0, tickCount); | ||
return fn(0, count); | ||
} | ||
export default getTickValues; |
@@ -36,3 +36,3 @@ /** | ||
} else { | ||
const str = '' + value; | ||
const str = `${value}`; | ||
const ary = str.split('.'); | ||
@@ -51,3 +51,3 @@ | ||
function getDecimalDigitCount(a) { | ||
const str = a ? '' + a : ''; | ||
const str = a ? `${a}` : ''; | ||
const ary = str.split('.'); | ||
@@ -58,2 +58,15 @@ | ||
/** | ||
* 乘法运算,解决了js运算的精度问题 | ||
* @param {Number} a 被乘数 | ||
* @param {Number} b 乘数 | ||
* @return {Number} 积 | ||
*/ | ||
function multiply(a, b) { | ||
const intA = parseInt((`${a}`).replace('.', ''), 10); | ||
const intB = parseInt((`${b}`).replace('.', ''), 10); | ||
const count = getDecimalDigitCount(a) + getDecimalDigitCount(b); | ||
return (intA * intB) / Math.pow(10, count); | ||
} | ||
/** | ||
* 加法运算,解决了js运算的精度问题 | ||
@@ -81,15 +94,2 @@ * @param {Number} a 被加数 | ||
/** | ||
* 乘法运算,解决了js运算的精度问题 | ||
* @param {Number} a 被乘数 | ||
* @param {Number} b 乘数 | ||
* @return {Number} 积 | ||
*/ | ||
function multiply(a, b) { | ||
const intA = parseInt(('' + a).replace('.', ''), 10); | ||
const intB = parseInt(('' + b).replace('.', ''), 10); | ||
const count = getDecimalDigitCount(a) + getDecimalDigitCount(b); | ||
return (intA * intB) / Math.pow(10, count); | ||
} | ||
/** | ||
* 除法运算,解决了js运算的精度问题 | ||
@@ -103,4 +103,4 @@ * @param {Number} a 被除数 | ||
const cb = getDecimalDigitCount(b); | ||
const intA = parseInt(('' + a).replace('.', ''), 10); | ||
const intB = parseInt(('' + b).replace('.', ''), 10); | ||
const intA = parseInt((`${a}`).replace('.', ''), 10); | ||
const intB = parseInt((`${b}`).replace('.', ''), 10); | ||
@@ -156,3 +156,3 @@ return (intA / intB) * Math.pow(10, cb - ca); | ||
diff = diff ? diff : Infinity; | ||
diff = diff || Infinity; | ||
@@ -173,3 +173,3 @@ return (x - a) / diff; | ||
diff = diff ? diff : Infinity; | ||
diff = diff || Infinity; | ||
@@ -176,0 +176,0 @@ return Math.max(0, Math.min(1, (x - a) / diff)); |
const identity = i => i; | ||
export const __ = { | ||
export const PLACE_HOLDER = { | ||
'@@functional/placeholder': true, | ||
}; | ||
const isPlaceHolder = val => val === __; | ||
const isPlaceHolder = val => val === PLACE_HOLDER; | ||
const _curry0 = (fn) => { | ||
return function _curried(...args) { | ||
if (args.length === 0 || args.length === 1 && isPlaceHolder(args[0])) { | ||
return _curried; | ||
} | ||
const curry0 = (fn) => function _curried(...args) { | ||
if (args.length === 0 || args.length === 1 && isPlaceHolder(args[0])) { | ||
return _curried; | ||
} | ||
return fn(...args); | ||
}; | ||
return fn(...args); | ||
}; | ||
@@ -24,4 +22,4 @@ | ||
return _curry0((...args) => { | ||
const argsLength = args.filter(arg => arg !== __).length; | ||
return curry0((...args) => { | ||
const argsLength = args.filter(arg => arg !== PLACE_HOLDER).length; | ||
@@ -32,6 +30,4 @@ if (argsLength >= n) { | ||
return curryN(n - argsLength, _curry0((...restArgs) => { | ||
const newArgs = args.map(arg => | ||
isPlaceHolder(arg) ? restArgs.shift() : arg | ||
); | ||
return curryN(n - argsLength, curry0((...restArgs) => { | ||
const newArgs = args.map(arg => (isPlaceHolder(arg) ? restArgs.shift() : arg)); | ||
@@ -43,5 +39,3 @@ return fn(...newArgs, ...restArgs); | ||
export const curry = fn => { | ||
return curryN(fn.length, fn); | ||
}; | ||
export const curry = fn => curryN(fn.length, fn); | ||
@@ -48,0 +42,0 @@ export const range = (begin, end) => { |
@@ -97,3 +97,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
var __ = exports.__ = { | ||
var PLACE_HOLDER = exports.PLACE_HOLDER = { | ||
'@@functional/placeholder': true | ||
@@ -103,6 +103,6 @@ }; | ||
var isPlaceHolder = function isPlaceHolder(val) { | ||
return val === __; | ||
return val === PLACE_HOLDER; | ||
}; | ||
var _curry0 = function _curry0(fn) { | ||
var curry0 = function curry0(fn) { | ||
return function _curried() { | ||
@@ -122,3 +122,3 @@ if (arguments.length === 0 || arguments.length === 1 && isPlaceHolder(arguments.length <= 0 ? undefined : arguments[0])) { | ||
return _curry0(function () { | ||
return curry0(function () { | ||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
@@ -129,3 +129,3 @@ args[_key] = arguments[_key]; | ||
var argsLength = args.filter(function (arg) { | ||
return arg !== __; | ||
return arg !== PLACE_HOLDER; | ||
}).length; | ||
@@ -137,3 +137,3 @@ | ||
return curryN(n - argsLength, _curry0(function () { | ||
return curryN(n - argsLength, curry0(function () { | ||
for (var _len2 = arguments.length, restArgs = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | ||
@@ -234,2 +234,6 @@ restArgs[_key2] = arguments[_key2]; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
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"); } }; }(); /** | ||
@@ -241,6 +245,2 @@ * @fileOverview calculate tick values of scale | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _utils = __webpack_require__(1); | ||
@@ -356,3 +356,3 @@ | ||
// 计算刻度的一个中间值 | ||
var middle = undefined; | ||
var middle = void 0; | ||
@@ -389,4 +389,3 @@ // 当0属于取值范围时 | ||
* | ||
* @param {Number} min 最小值 | ||
* @param {Number} max 最大值 | ||
* @param {Number} min, max min: 最小值, max: 最大值 | ||
* @param {Integer} tickCount 刻度数 | ||
@@ -412,2 +411,3 @@ * @return {Array} 取刻度数组 | ||
if (cormin === cormax) { | ||
@@ -425,2 +425,3 @@ return getTickOfSingleValue(cormin, tickCount); | ||
var values = _arithmetic2.default.rangeStep(tickMin, tickMax + 0.1 * step, step); | ||
@@ -456,5 +457,5 @@ | ||
tickCount = Math.max(tickCount, 2); | ||
var count = Math.max(tickCount, 2); | ||
var step = (domain[1] - domain[0]) / (tickCount - 1); | ||
var step = (domain[1] - domain[0]) / (count - 1); | ||
@@ -465,3 +466,3 @@ var fn = (0, _utils.compose)((0, _utils.map)(function (n) { | ||
return fn(0, tickCount); | ||
return fn(0, count); | ||
} | ||
@@ -510,3 +511,3 @@ | ||
var abs = Math.abs(value); | ||
var result = undefined; | ||
var result = void 0; | ||
@@ -538,2 +539,15 @@ if (value === 0) { | ||
/** | ||
* 乘法运算,解决了js运算的精度问题 | ||
* @param {Number} a 被乘数 | ||
* @param {Number} b 乘数 | ||
* @return {Number} 积 | ||
*/ | ||
function multiply(a, b) { | ||
var intA = parseInt(('' + a).replace('.', ''), 10); | ||
var intB = parseInt(('' + b).replace('.', ''), 10); | ||
var count = getDecimalDigitCount(a) + getDecimalDigitCount(b); | ||
return intA * intB / Math.pow(10, count); | ||
} | ||
/** | ||
* 加法运算,解决了js运算的精度问题 | ||
@@ -561,15 +575,2 @@ * @param {Number} a 被加数 | ||
/** | ||
* 乘法运算,解决了js运算的精度问题 | ||
* @param {Number} a 被乘数 | ||
* @param {Number} b 乘数 | ||
* @return {Number} 积 | ||
*/ | ||
function multiply(a, b) { | ||
var intA = parseInt(('' + a).replace('.', ''), 10); | ||
var intB = parseInt(('' + b).replace('.', ''), 10); | ||
var count = getDecimalDigitCount(a) + getDecimalDigitCount(b); | ||
return intA * intB / Math.pow(10, count); | ||
} | ||
/** | ||
* 除法运算,解决了js运算的精度问题 | ||
@@ -635,3 +636,3 @@ * @param {Number} a 被除数 | ||
diff = diff ? diff : Infinity; | ||
diff = diff || Infinity; | ||
@@ -652,3 +653,3 @@ return (x - a) / diff; | ||
diff = diff ? diff : Infinity; | ||
diff = diff || Infinity; | ||
@@ -655,0 +656,0 @@ return Math.max(0, Math.min(1, (x - a) / diff)); |
@@ -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";function n(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e.getNiceTickValues=e.getTickValues=void 0;var u=r(3),a=n(u),i=r(2),o=n(i);e["default"]={getTickValues:a["default"],getNiceTickValues:o["default"]},e.getTickValues=a["default"],e.getNiceTickValues=o["default"]},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.__={"@@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 f(t,e){return 1===t?e:i(function(){for(var n=arguments.length,o=Array(n),l=0;n>l;l++)o[l]=arguments[l];var c=o.filter(function(t){return t!==u}).length;return c>=t?e.apply(void 0,o):f(t-c,i(function(){for(var t=arguments.length,n=Array(t),u=0;t>u;u++)n[u]=arguments[u];var i=o.map(function(t){return a(t)?n.shift():t});return e.apply(void 0,r(i).concat(n))}))})},l=e.curry=function(t){return o(t.length,t)};e.range=function(t,e){for(var r=[],n=t;e>n;++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;t>r;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;n>a;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=f(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){if(0>=t)return 0;var r=p["default"].getDigitCount(t),n=t/Math.pow(10,r),u=p["default"].multiply(Math.ceil(n/.05)+e,.05),a=p["default"].multiply(u,Math.pow(10,r));return a}function i(t,e){var r=p["default"].isFloat(t),n=1,u=t;if(r){var a=Math.abs(t);1>a?(n=Math.pow(10,p["default"].getDigitCount(t)-1),u=p["default"].multiply(Math.floor(t/n),n)):a>1&&(u=Math.floor(t))}else 0===t&&(u=Math.floor((e-1)/2));var i=Math.floor((e-1)/2),o=(0,c.compose)((0,c.map)(function(t){return p["default"].sum(u,p["default"].multiply(t-i,n))}),c.range);return o(0,e)}function o(t,e,r){var n=arguments.length<=3||void 0===arguments[3]?0:arguments[3],u=a((e-t)/(r-1),n),i=void 0;0>=t&&e>=0?i=0:(i=(t+e)/2,i-=i%u);var l=Math.ceil((i-t)/u),f=Math.ceil((e-i)/u),c=l+f+1;return c>r?o(t,e,r,n+1):(r>c&&(f=e>0?f+(r-c):f,l=e>0?l:l+(r-c)),{step:u,tickMin:p["default"].minus(i,p["default"].multiply(l,u)),tickMax:p["default"].sum(i,p["default"].multiply(f,u))})}function l(t){var e=f(t,2),r=e[0],n=e[1],a=arguments.length<=1||void 0===arguments[1]?6:arguments[1],l=Math.max(a,2),s=u([r,n]),d=f(s,2),v=d[0],m=d[1];if(v===m)return i(v,a);var g=o(v,m,l),h=g.step,y=g.tickMin,M=g.tickMax,_=p["default"].rangeStep(y,M+.1*h,h);return r>n?(0,c.reverse)(_):_}var f=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(l){u=!0,a=l}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")}}();Object.defineProperty(e,"__esModule",{value:!0});var c=r(1),s=r(4),p=n(s);e["default"]=(0,c.memoize)(l)},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function u(t,e){if(t[0]===t[1])return(0,o["default"])(t,e);e=Math.max(e,2);var r=(t[1]-t[0])/(e-1),n=(0,a.compose)((0,a.map)(function(e){return t[0]+e*r}),a.range);return n(0,e)}Object.defineProperty(e,"__esModule",{value:!0});var a=r(1),i=r(2),o=n(i);e["default"]=u},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(1>e)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=Math.max(a(t),a(e));return r=Math.pow(10,r),(l(t,r)+l(e,r))/r}function o(t,e){return i(t,-e)}function l(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 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,r){for(var n=t,u=[];e>n;)u.push(n),n=i(n,r);return u}Object.defineProperty(e,"__esModule",{value:!0});var s=r(1),p=(0,s.curry)(function(t,e,r){var n=+t,u=+e;return n+r*(u-n)}),d=(0,s.curry)(function(t,e,r){var n=e-+t;return n=n?n:1/0,(r-t)/n}),v=(0,s.curry)(function(t,e,r){var n=e-+t;return n=n?n:1/0,Math.max(0,Math.min(1,(r-t)/n))});e["default"]={rangeStep:c,isFloat:n,getDigitCount:u,getDecimalDigitCount:a,sum:i,minus:o,multiply:l,divide:f,interpolateNumber:p,uninterpolateNumber:d,uninterpolateTruncation:v}}])}); | ||
!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";function n(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e.getNiceTickValues=e.getTickValues=void 0;var u=r(3),a=n(u),i=r(2),o=n(i);e["default"]={getTickValues:a["default"],getNiceTickValues:o["default"]},e.getTickValues=a["default"],e.getNiceTickValues=o["default"]},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 f(t,e){return 1===t?e:i(function(){for(var n=arguments.length,o=Array(n),l=0;l<n;l++)o[l]=arguments[l];var c=o.filter(function(t){return t!==u}).length;return c>=t?e.apply(void 0,o):f(t-c,i(function(){for(var t=arguments.length,n=Array(t),u=0;u<t;u++)n[u]=arguments[u];var i=o.map(function(t){return a(t)?n.shift():t});return e.apply(void 0,r(i).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(),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=f(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){if(t<=0)return 0;var r=p["default"].getDigitCount(t),n=t/Math.pow(10,r),u=p["default"].multiply(Math.ceil(n/.05)+e,.05),a=p["default"].multiply(u,Math.pow(10,r));return a}function i(t,e){var r=p["default"].isFloat(t),n=1,u=t;if(r){var a=Math.abs(t);a<1?(n=Math.pow(10,p["default"].getDigitCount(t)-1),u=p["default"].multiply(Math.floor(t/n),n)):a>1&&(u=Math.floor(t))}else 0===t&&(u=Math.floor((e-1)/2));var i=Math.floor((e-1)/2),o=(0,c.compose)((0,c.map)(function(t){return p["default"].sum(u,p["default"].multiply(t-i,n))}),c.range);return o(0,e)}function o(t,e,r){var n=arguments.length<=3||void 0===arguments[3]?0:arguments[3],u=a((e-t)/(r-1),n),i=void 0;t<=0&&e>=0?i=0:(i=(t+e)/2,i-=i%u);var l=Math.ceil((i-t)/u),f=Math.ceil((e-i)/u),c=l+f+1;return c>r?o(t,e,r,n+1):(c<r&&(f=e>0?f+(r-c):f,l=e>0?l:l+(r-c)),{step:u,tickMin:p["default"].minus(i,p["default"].multiply(l,u)),tickMax:p["default"].sum(i,p["default"].multiply(f,u))})}function l(t){var e=f(t,2),r=e[0],n=e[1],a=arguments.length<=1||void 0===arguments[1]?6:arguments[1],l=Math.max(a,2),s=u([r,n]),d=f(s,2),v=d[0],h=d[1];if(v===h)return i(v,a);var y=o(v,h,l),m=y.step,g=y.tickMin,M=y.tickMax,b=p["default"].rangeStep(g,M+.1*m,m);return r>n?(0,c.reverse)(b):b}Object.defineProperty(e,"__esModule",{value:!0});var f=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(l){u=!0,a=l}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")}}(),c=r(1),s=r(4),p=n(s);e["default"]=(0,c.memoize)(l)},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{"default":t}}function u(t,e){if(t[0]===t[1])return(0,o["default"])(t,e);var r=Math.max(e,2),n=(t[1]-t[0])/(r-1),u=(0,a.compose)((0,a.map)(function(e){return t[0]+e*n}),a.range);return u(0,r)}Object.defineProperty(e,"__esModule",{value:!0});var a=r(1),i=r(2),o=n(i);e["default"]=u},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,r){for(var n=t,u=[];n<e;)u.push(n),n=o(n,r);return u}Object.defineProperty(e,"__esModule",{value:!0});var s=r(1),p=(0,s.curry)(function(t,e,r){var n=+t,u=+e;return n+r*(u-n)}),d=(0,s.curry)(function(t,e,r){var n=e-+t;return n=n||1/0,(r-t)/n}),v=(0,s.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:c,isFloat:n,getDigitCount:u,getDecimalDigitCount:a,sum:o,minus:l,multiply:i,divide:f,interpolateNumber:p,uninterpolateNumber:d,uninterpolateTruncation:v}}])}); |
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
78682
17
1832