How to use the d3-random.randomLogNormal.source function in d3-random

To help you get started, we’ve selected a few d3-random examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github huy-nguyen / squarify / src / __tests__ / index.js View on Github external
test('Should not cause stack overflow for large input', () => {
  const randomNumberGenerator = randomLogNormal.source(seedRandom('abc'))();
  const size = 10000;
  const data  = [];
  for (let i = 0; i < size; i += 1) {
    const datum = {
      value: Math.ceil(randomNumberGenerator() * 10000),
    };
    data.push(datum);
  }


  expect(() => entry(data, {x0: 0, y0: 0, x1: 1000, y1: 1000})).not.toThrow();
});