Comparing version 0.2.1 to 0.3.0
@@ -0,5 +1,6 @@ | ||
// https://d3js.org/d3-random/ Version 0.3.0. Copyright 2016 Mike Bostock. | ||
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
(factory((global.d3_random = {}))); | ||
(factory((global.d3 = global.d3 || {}))); | ||
}(this, function (exports) { 'use strict'; | ||
@@ -65,5 +66,2 @@ | ||
var version = "0.2.1"; | ||
exports.version = version; | ||
exports.randomUniform = uniform; | ||
@@ -76,2 +74,4 @@ exports.randomNormal = normal; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
})); |
@@ -1,1 +0,2 @@ | ||
!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(n.d3_random={})}(this,function(n){"use strict";function r(n,r){return n=null==n?0:+n,r=null==r?1:+r,1===arguments.length?(r=n,n=0):r-=n,function(){return Math.random()*r+n}}function t(n,r){var t,o;return n=null==n?0:+n,r=null==r?1:+r,function(){var e;if(null!=t)e=t,t=null;else do t=2*Math.random()-1,e=2*Math.random()-1,o=t*t+e*e;while(!o||o>1);return n+r*e*Math.sqrt(-2*Math.log(o)/o)}}function o(){var n=t.apply(this,arguments);return function(){return Math.exp(n())}}function e(n){return function(){for(var r=0,t=0;n>t;++t)r+=Math.random();return r}}function u(n){var r=e(n);return function(){return r()/n}}function a(n){return function(){return-Math.log(1-Math.random())/n}}var i="0.2.1";n.version=i,n.randomUniform=r,n.randomNormal=t,n.randomLogNormal=o,n.randomBates=u,n.randomIrwinHall=e,n.randomExponential=a}); | ||
// https://d3js.org/d3-random/ Version 0.3.0. Copyright 2016 Mike Bostock. | ||
!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(n.d3=n.d3||{})}(this,function(n){"use strict";function t(n,t){return n=null==n?0:+n,t=null==t?1:+t,1===arguments.length?(t=n,n=0):t-=n,function(){return Math.random()*t+n}}function r(n,t){var r,o;return n=null==n?0:+n,t=null==t?1:+t,function(){var e;if(null!=r)e=r,r=null;else do r=2*Math.random()-1,e=2*Math.random()-1,o=r*r+e*e;while(!o||o>1);return n+t*e*Math.sqrt(-2*Math.log(o)/o)}}function o(){var n=r.apply(this,arguments);return function(){return Math.exp(n())}}function e(n){return function(){for(var t=0,r=0;n>r;++r)t+=Math.random();return t}}function u(n){var t=e(n);return function(){return t()/n}}function a(n){return function(){return-Math.log(1-Math.random())/n}}n.randomUniform=t,n.randomNormal=r,n.randomLogNormal=o,n.randomBates=u,n.randomIrwinHall=e,n.randomExponential=a,Object.defineProperty(n,"__esModule",{value:!0})}); |
{ | ||
"name": "d3-random", | ||
"version": "0.2.1", | ||
"version": "0.3.0", | ||
"description": "Generate random numbers from various distributions.", | ||
@@ -10,3 +10,3 @@ "keywords": [ | ||
], | ||
"homepage": "https://github.com/d3/d3-random", | ||
"homepage": "https://d3js.org/d3-random/", | ||
"license": "BSD-3-Clause", | ||
@@ -24,11 +24,12 @@ "author": { | ||
"scripts": { | ||
"pretest": "mkdir -p build && node -e 'process.stdout.write(\"var version = \\\"\" + require(\"./package.json\").version + \"\\\"; export * from \\\"../index\\\"; export {version};\");' > build/bundle.js && rollup -f umd -n d3_random -o build/d3-random.js -- build/bundle.js", | ||
"test": "faucet `find test -name '*-test.js'` && eslint index.js src", | ||
"prepublish": "npm run test && uglifyjs build/d3-random.js -c -m -o build/d3-random.min.js && rm -f build/d3-random.zip && zip -j build/d3-random.zip -- LICENSE README.md build/d3-random.js build/d3-random.min.js", | ||
"postpublish": "VERSION=`node -e 'console.log(require(\"./package.json\").version)'`; git push && git tag -am \"Release $VERSION.\" v${VERSION} && git push --tags && cp build/d3-random.js ../d3.github.com/d3-random.v0.2.js && cp build/d3-random.min.js ../d3.github.com/d3-random.v0.2.min.js && cd ../d3.github.com && git add d3-random.v0.2.js d3-random.v0.2.min.js && git commit -m \"d3-random ${VERSION}\" && git push" | ||
"pretest": "rm -rf build && mkdir build && rollup --banner \"$(preamble)\" -f umd -n d3 -o build/d3-random.js -- index.js", | ||
"test": "tape 'test/**/*-test.js' && eslint index.js src", | ||
"prepublish": "npm run test && uglifyjs --preamble \"$(preamble)\" build/d3-random.js -c -m -o build/d3-random.min.js", | ||
"postpublish": "VERSION=`node -e 'console.log(require(\"./package.json\").version)'`; git push && git push --tags && cp build/d3-random.js ../d3.github.com/d3-random.v0.3.js && cp build/d3-random.min.js ../d3.github.com/d3-random.v0.3.min.js && cd ../d3.github.com && git add d3-random.v0.3.js d3-random.v0.3.min.js && git commit -m \"d3-random ${VERSION}\" && git push && cd - && zip -j build/d3-random.zip -- LICENSE README.md build/d3-random.js build/d3-random.min.js" | ||
}, | ||
"devDependencies": { | ||
"d3-array": "~0.7.1", | ||
"faucet": "0.0", | ||
"rollup": "0.25", | ||
"d3-array": "~0.8.0", | ||
"eslint": "2", | ||
"package-preamble": "0.0", | ||
"rollup": "0.27", | ||
"seedrandom": "2", | ||
@@ -35,0 +36,0 @@ "tape": "4", |
@@ -7,9 +7,14 @@ # d3-random | ||
If you use NPM, `npm install d3-random`. Otherwise, download the [latest release](https://github.com/d3/d3-random/releases/latest). The released bundle supports AMD, CommonJS, and vanilla environments. Create a custom build using [Rollup](https://github.com/rollup/rollup) or your preferred bundler. You can also load directly from [d3js.org](https://d3js.org): | ||
If you use NPM, `npm install d3-random`. Otherwise, download the [latest release](https://github.com/d3/d3-random/releases/latest). You can also load directly from [d3js.org](https://d3js.org), either as a [standalone library](https://d3js.org/d3-random.v0.3.min.js) or as part of [D3 4.0](https://github.com/d3/d3). AMD, CommonJS, and vanilla environments are supported. In vanilla, a `d3` global is exported: | ||
```html | ||
<script src="https://d3js.org/d3-random.v0.2.min.js"></script> | ||
<script src="https://d3js.org/d3-random.v0.3.min.js"></script> | ||
<script> | ||
var random = d3.randomUniform(1, 10); | ||
</script> | ||
``` | ||
In a vanilla environment, a `d3_random` global is exported. [Try d3-random in your browser.](https://tonicdev.com/npm/d3-random) | ||
[Try d3-random in your browser.](https://tonicdev.com/npm/d3-random) | ||
@@ -16,0 +21,0 @@ ## API Reference |
Sorry, the diff of this file is not supported yet
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
120
52
11424
7
14