add lisp packages
This commit is contained in:
115
lisp/emacs-application-framework/app/mermaid/node_modules/d3-random/dist/d3-random.js
generated
vendored
Normal file
115
lisp/emacs-application-framework/app/mermaid/node_modules/d3-random/dist/d3-random.js
generated
vendored
Normal file
@@ -0,0 +1,115 @@
|
||||
// https://d3js.org/d3-random/ v1.1.2 Copyright 2018 Mike Bostock
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
||||
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
||||
(factory((global.d3 = global.d3 || {})));
|
||||
}(this, (function (exports) { 'use strict';
|
||||
|
||||
function defaultSource() {
|
||||
return Math.random();
|
||||
}
|
||||
|
||||
var uniform = (function sourceRandomUniform(source) {
|
||||
function randomUniform(min, max) {
|
||||
min = min == null ? 0 : +min;
|
||||
max = max == null ? 1 : +max;
|
||||
if (arguments.length === 1) max = min, min = 0;
|
||||
else max -= min;
|
||||
return function() {
|
||||
return source() * max + min;
|
||||
};
|
||||
}
|
||||
|
||||
randomUniform.source = sourceRandomUniform;
|
||||
|
||||
return randomUniform;
|
||||
})(defaultSource);
|
||||
|
||||
var normal = (function sourceRandomNormal(source) {
|
||||
function randomNormal(mu, sigma) {
|
||||
var x, r;
|
||||
mu = mu == null ? 0 : +mu;
|
||||
sigma = sigma == null ? 1 : +sigma;
|
||||
return function() {
|
||||
var y;
|
||||
|
||||
// If available, use the second previously-generated uniform random.
|
||||
if (x != null) y = x, x = null;
|
||||
|
||||
// Otherwise, generate a new x and y.
|
||||
else do {
|
||||
x = source() * 2 - 1;
|
||||
y = source() * 2 - 1;
|
||||
r = x * x + y * y;
|
||||
} while (!r || r > 1);
|
||||
|
||||
return mu + sigma * y * Math.sqrt(-2 * Math.log(r) / r);
|
||||
};
|
||||
}
|
||||
|
||||
randomNormal.source = sourceRandomNormal;
|
||||
|
||||
return randomNormal;
|
||||
})(defaultSource);
|
||||
|
||||
var logNormal = (function sourceRandomLogNormal(source) {
|
||||
function randomLogNormal() {
|
||||
var randomNormal = normal.source(source).apply(this, arguments);
|
||||
return function() {
|
||||
return Math.exp(randomNormal());
|
||||
};
|
||||
}
|
||||
|
||||
randomLogNormal.source = sourceRandomLogNormal;
|
||||
|
||||
return randomLogNormal;
|
||||
})(defaultSource);
|
||||
|
||||
var irwinHall = (function sourceRandomIrwinHall(source) {
|
||||
function randomIrwinHall(n) {
|
||||
return function() {
|
||||
for (var sum = 0, i = 0; i < n; ++i) sum += source();
|
||||
return sum;
|
||||
};
|
||||
}
|
||||
|
||||
randomIrwinHall.source = sourceRandomIrwinHall;
|
||||
|
||||
return randomIrwinHall;
|
||||
})(defaultSource);
|
||||
|
||||
var bates = (function sourceRandomBates(source) {
|
||||
function randomBates(n) {
|
||||
var randomIrwinHall = irwinHall.source(source)(n);
|
||||
return function() {
|
||||
return randomIrwinHall() / n;
|
||||
};
|
||||
}
|
||||
|
||||
randomBates.source = sourceRandomBates;
|
||||
|
||||
return randomBates;
|
||||
})(defaultSource);
|
||||
|
||||
var exponential = (function sourceRandomExponential(source) {
|
||||
function randomExponential(lambda) {
|
||||
return function() {
|
||||
return -Math.log(1 - source()) / lambda;
|
||||
};
|
||||
}
|
||||
|
||||
randomExponential.source = sourceRandomExponential;
|
||||
|
||||
return randomExponential;
|
||||
})(defaultSource);
|
||||
|
||||
exports.randomUniform = uniform;
|
||||
exports.randomNormal = normal;
|
||||
exports.randomLogNormal = logNormal;
|
||||
exports.randomBates = bates;
|
||||
exports.randomIrwinHall = irwinHall;
|
||||
exports.randomExponential = exponential;
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
})));
|
||||
2
lisp/emacs-application-framework/app/mermaid/node_modules/d3-random/dist/d3-random.min.js
generated
vendored
Normal file
2
lisp/emacs-application-framework/app/mermaid/node_modules/d3-random/dist/d3-random.min.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
// https://d3js.org/d3-random/ v1.1.2 Copyright 2018 Mike Bostock
|
||||
!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(n.d3=n.d3||{})}(this,function(n){"use strict";function r(){return Math.random()}var t=function n(r){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 r()*t+n}}return t.source=n,t}(r),u=function n(r){function t(n,t){var u,e;return n=null==n?0:+n,t=null==t?1:+t,function(){var o;if(null!=u)o=u,u=null;else do{u=2*r()-1,o=2*r()-1,e=u*u+o*o}while(!e||e>1);return n+t*o*Math.sqrt(-2*Math.log(e)/e)}}return t.source=n,t}(r),e=function n(r){function t(){var n=u.source(r).apply(this,arguments);return function(){return Math.exp(n())}}return t.source=n,t}(r),o=function n(r){function t(n){return function(){for(var t=0,u=0;u<n;++u)t+=r();return t}}return t.source=n,t}(r),i=function n(r){function t(n){var t=o.source(r)(n);return function(){return t()/n}}return t.source=n,t}(r),c=function n(r){function t(n){return function(){return-Math.log(1-r())/n}}return t.source=n,t}(r);n.randomUniform=t,n.randomNormal=u,n.randomLogNormal=e,n.randomBates=i,n.randomIrwinHall=o,n.randomExponential=c,Object.defineProperty(n,"__esModule",{value:!0})});
|
||||
Reference in New Issue
Block a user