Math

Math

API ReferenceCoreMath

Pseudorandom Number Generation

You can use the built-in Math.random to generate uniform distributions. For example, to generate a random integer between 0 and 99 (inclusive), you can say Math.floor(Math.random() * 100).

d3.random.normal([mean, [deviation]])

Returns a function for generating random numbers with a normal (Gaussian) distribution. The expected value of the generated pseudorandom numbers is mean, with the given standard deviation登录查看完整内容