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

math-helper-functions

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

math-helper-functions - npm Package Compare versions

Comparing version 1.3.1 to 1.4.0

6

index.js

@@ -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.&lt;number&gt;</code> \| <code>Array.&lt;string&gt;</code> | Array to find distribution of |
| [numOfBins] | <code>number</code> | Number of bins to use (optional) |
| Param | Type | Description |
| ----------- | --------------------------------- | -------------------------------- |
| array | <code>Array.&lt;number&gt;</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>

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