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

d3-random

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d3-random - npm Package Compare versions

Comparing version 0.0.0 to 0.0.1

.npmignore

61

index.js

@@ -1,48 +0,13 @@

(function() {
!function() {
var d3 = {
version: "3.4.4"
};
d3.random = {
normal: function(µ, σ) {
var n = arguments.length;
if (n < 2) σ = 1;
if (n < 1) µ = 0;
return function() {
var x, y, r;
do {
x = Math.random() * 2 - 1;
y = Math.random() * 2 - 1;
r = x * x + y * y;
} while (!r || r > 1);
return µ + σ * x * Math.sqrt(-2 * Math.log(r) / r);
};
},
logNormal: function() {
var random = d3.random.normal.apply(d3, arguments);
return function() {
return Math.exp(random());
};
},
bates: function(m) {
var random = d3.random.irwinHall(m);
return function() {
return random() / m;
};
},
irwinHall: function(m) {
return function() {
for (var s = 0, j = 0; j < m; j++) s += Math.random();
return s;
};
}
};
if (typeof define === "function" && define.amd) {
define(d3);
} else if (typeof module === "object" && module.exports) {
module.exports = d3;
} else {
this.d3 = d3;
}
}();
})();
import uniform from "./src/uniform";
import normal from "./src/normal";
import logNormal from "./src/logNormal";
import bates from "./src/bates";
import irwinHall from "./src/irwinHall";
export {
uniform,
normal,
logNormal,
bates,
irwinHall
};
{
"name": "d3-random",
"version": "0.0.0",
"description": "The d3.random function from d3",
"main": "index.js",
"scripts": {
"build": "smash node_modules/d3/src/start.js node_modules/d3/src/math/random.js node_modules/d3/src/end.js | uglifyjs - -b -indent-level=2 -o index.js",
"test": "echo \"Error: no test specified\" && exit 1"
"version": "0.0.1",
"description": "Generate random numbers from various distributions.",
"keywords": [
"d3",
"random",
"rng"
],
"homepage": "https://github.com/d3/d3-random",
"license": "BSD-3-Clause",
"author": {
"name": "Mike Bostock",
"url": "http://bost.ocks.org/mike"
},
"main": "build/random",
"jsnext:main": "index",
"repository": {
"type": "git",
"url": "https://github.com/jfsiii/d3-random.git"
"url": "https://github.com/d3/d3-random.git"
},
"keywords": [
"d3"
],
"author": "JFSIII",
"license": "ISC",
"scripts": {
"pretest": "mkdir -p build && d3-bundler --format=umd --name=random -- index.js > build/random.js",
"test": "faucet `find test -name '*-test.js'`",
"prepublish": "npm run test && uglifyjs build/random.js -c -m -o build/random.min.js"
},
"devDependencies": {
"d3": "^3.4.4",
"smash": "0.0.12",
"uglify-js": "^2.4.13"
"d3-arrays": "~0.0.3",
"d3-bundler": "~0.2.6",
"faucet": "0.0",
"seedrandom": "2",
"tape": "4",
"uglifyjs": "2"
}
}
}
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