math-helper-functions
Advanced tools
Comparing version 1.3.1 to 1.4.0
@@ -5,3 +5,2 @@ const {max, min, mean, median, histogram} = require('d3-array'); | ||
const get = require('lodash/get'); | ||
const {processNumber} = require('number-helper-functions'); | ||
@@ -139,3 +138,3 @@ /** | ||
* @static | ||
* @param {number[]|string[]} array Array to find distribution of | ||
* @param {number[]} array Array to find distribution of | ||
* @param {number} [numOfBins] Number of bins to use (optional) | ||
@@ -146,5 +145,4 @@ * @returns {object} Distribution of the array's values | ||
static calcDistribution(array, numOfBins) { | ||
const numArray = array.map((d) => processNumber(d)); | ||
const hist = numOfBins ? histogram().thresholds(numOfBins) : histogram(); | ||
const dist = hist(numArray); | ||
const dist = hist(array); | ||
const graphData = { | ||
@@ -151,0 +149,0 @@ labels: [], |
{ | ||
"name": "math-helper-functions", | ||
"version": "1.3.1", | ||
"version": "1.4.0", | ||
"description": "Helper with misc. math functions such as sums, averages, max, min, etc", | ||
@@ -31,4 +31,3 @@ "main": "index.js", | ||
"d3-array": "^2.0.3", | ||
"lodash": "^4.17.15", | ||
"number-helper-functions": "^2.1.0" | ||
"lodash": "^4.17.15" | ||
}, | ||
@@ -35,0 +34,0 @@ "prettier": { |
@@ -151,6 +151,6 @@ <a name="MathFunctions"></a> | ||
| Param | Type | Description | | ||
| ----------- | ---------------------------------------------------------------------- | -------------------------------- | | ||
| array | <code>Array.<number></code> \| <code>Array.<string></code> | Array to find distribution of | | ||
| [numOfBins] | <code>number</code> | Number of bins to use (optional) | | ||
| Param | Type | Description | | ||
| ----------- | --------------------------------- | -------------------------------- | | ||
| array | <code>Array.<number></code> | Array to find distribution of | | ||
| [numOfBins] | <code>number</code> | Number of bins to use (optional) | | ||
@@ -157,0 +157,0 @@ <a name="MathFunctions.calcQuartiles"></a> |
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
2
25277
459
- Removednumber-helper-functions@^2.1.0
- Removednumber-helper-functions@2.1.1(transitive)