How to use d3-random - 10 common examples

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 DefinitelyTyped / DefinitelyTyped / d3-random / d3-random-tests.ts View on Github external
*/

import * as d3Random from 'd3-random';


// ------------------------------------------------------------
// Preparatory Steps
// ------------------------------------------------------------

let randomNumberGenerator: () => number;

// ------------------------------------------------------------
// randomUniform
// ------------------------------------------------------------

randomNumberGenerator = d3Random.randomUniform();
randomNumberGenerator = d3Random.randomUniform(0.2);
randomNumberGenerator = d3Random.randomUniform(0.2, 5);

// ------------------------------------------------------------
// randomNormal
// ------------------------------------------------------------

randomNumberGenerator = d3Random.randomNormal();
randomNumberGenerator = d3Random.randomNormal(3);
randomNumberGenerator = d3Random.randomNormal(3, 4);

// ------------------------------------------------------------
// randomLogNormal
// ------------------------------------------------------------

randomNumberGenerator = d3Random.randomLogNormal();
github DefinitelyTyped / DefinitelyTyped / d3-random / d3-random-tests.ts View on Github external
import * as d3Random from 'd3-random';


// ------------------------------------------------------------
// Preparatory Steps
// ------------------------------------------------------------

let randomNumberGenerator: () => number;

// ------------------------------------------------------------
// randomUniform
// ------------------------------------------------------------

randomNumberGenerator = d3Random.randomUniform();
randomNumberGenerator = d3Random.randomUniform(0.2);
randomNumberGenerator = d3Random.randomUniform(0.2, 5);

// ------------------------------------------------------------
// randomNormal
// ------------------------------------------------------------

randomNumberGenerator = d3Random.randomNormal();
randomNumberGenerator = d3Random.randomNormal(3);
randomNumberGenerator = d3Random.randomNormal(3, 4);

// ------------------------------------------------------------
// randomLogNormal
// ------------------------------------------------------------

randomNumberGenerator = d3Random.randomLogNormal();
randomNumberGenerator = d3Random.randomLogNormal(3);
github DefinitelyTyped / DefinitelyTyped / d3-random / d3-random-tests.ts View on Github external
import * as d3Random from 'd3-random';


// ------------------------------------------------------------
// Preparatory Steps
// ------------------------------------------------------------

let randomNumberGenerator: () => number;

// ------------------------------------------------------------
// randomUniform
// ------------------------------------------------------------

randomNumberGenerator = d3Random.randomUniform();
randomNumberGenerator = d3Random.randomUniform(0.2);
randomNumberGenerator = d3Random.randomUniform(0.2, 5);

// ------------------------------------------------------------
// randomNormal
// ------------------------------------------------------------

randomNumberGenerator = d3Random.randomNormal();
randomNumberGenerator = d3Random.randomNormal(3);
randomNumberGenerator = d3Random.randomNormal(3, 4);

// ------------------------------------------------------------
// randomLogNormal
// ------------------------------------------------------------

randomNumberGenerator = d3Random.randomLogNormal();
randomNumberGenerator = d3Random.randomLogNormal(3);
randomNumberGenerator = d3Random.randomLogNormal(3, 4);
github DefinitelyTyped / DefinitelyTyped / d3-random / d3-random-tests.ts View on Github external
// ------------------------------------------------------------
// randomNormal
// ------------------------------------------------------------

randomNumberGenerator = d3Random.randomNormal();
randomNumberGenerator = d3Random.randomNormal(3);
randomNumberGenerator = d3Random.randomNormal(3, 4);

// ------------------------------------------------------------
// randomLogNormal
// ------------------------------------------------------------

randomNumberGenerator = d3Random.randomLogNormal();
randomNumberGenerator = d3Random.randomLogNormal(3);
randomNumberGenerator = d3Random.randomLogNormal(3, 4);

// ------------------------------------------------------------
// randomBates
// ------------------------------------------------------------

randomNumberGenerator = d3Random.randomBates(3);

// ------------------------------------------------------------
// randomIrwinHall
// ------------------------------------------------------------

randomNumberGenerator = d3Random.randomIrwinHall(3);

// ------------------------------------------------------------
// randomExponential
// ------------------------------------------------------------
github DefinitelyTyped / DefinitelyTyped / d3-random / d3-random-tests.ts View on Github external
randomNumberGenerator = d3Random.randomUniform(0.2, 5);

// ------------------------------------------------------------
// randomNormal
// ------------------------------------------------------------

randomNumberGenerator = d3Random.randomNormal();
randomNumberGenerator = d3Random.randomNormal(3);
randomNumberGenerator = d3Random.randomNormal(3, 4);

// ------------------------------------------------------------
// randomLogNormal
// ------------------------------------------------------------

randomNumberGenerator = d3Random.randomLogNormal();
randomNumberGenerator = d3Random.randomLogNormal(3);
randomNumberGenerator = d3Random.randomLogNormal(3, 4);

// ------------------------------------------------------------
// randomBates
// ------------------------------------------------------------

randomNumberGenerator = d3Random.randomBates(3);

// ------------------------------------------------------------
// randomIrwinHall
// ------------------------------------------------------------

randomNumberGenerator = d3Random.randomIrwinHall(3);

// ------------------------------------------------------------
// randomExponential
github DefinitelyTyped / DefinitelyTyped / d3-random / d3-random-tests.ts View on Github external
randomNumberGenerator = d3Random.randomUniform(0.2);
randomNumberGenerator = d3Random.randomUniform(0.2, 5);

// ------------------------------------------------------------
// randomNormal
// ------------------------------------------------------------

randomNumberGenerator = d3Random.randomNormal();
randomNumberGenerator = d3Random.randomNormal(3);
randomNumberGenerator = d3Random.randomNormal(3, 4);

// ------------------------------------------------------------
// randomLogNormal
// ------------------------------------------------------------

randomNumberGenerator = d3Random.randomLogNormal();
randomNumberGenerator = d3Random.randomLogNormal(3);
randomNumberGenerator = d3Random.randomLogNormal(3, 4);

// ------------------------------------------------------------
// randomBates
// ------------------------------------------------------------

randomNumberGenerator = d3Random.randomBates(3);

// ------------------------------------------------------------
// randomIrwinHall
// ------------------------------------------------------------

randomNumberGenerator = d3Random.randomIrwinHall(3);

// ------------------------------------------------------------
github DefinitelyTyped / DefinitelyTyped / d3-random / d3-random-tests.ts View on Github external
randomNumberGenerator = d3Random.randomNormal(3);
randomNumberGenerator = d3Random.randomNormal(3, 4);

// ------------------------------------------------------------
// randomLogNormal
// ------------------------------------------------------------

randomNumberGenerator = d3Random.randomLogNormal();
randomNumberGenerator = d3Random.randomLogNormal(3);
randomNumberGenerator = d3Random.randomLogNormal(3, 4);

// ------------------------------------------------------------
// randomBates
// ------------------------------------------------------------

randomNumberGenerator = d3Random.randomBates(3);

// ------------------------------------------------------------
// randomIrwinHall
// ------------------------------------------------------------

randomNumberGenerator = d3Random.randomIrwinHall(3);

// ------------------------------------------------------------
// randomExponential
// ------------------------------------------------------------

randomNumberGenerator = d3Random.randomExponential(1 / 40);
github DefinitelyTyped / DefinitelyTyped / d3-random / d3-random-tests.ts View on Github external
// randomBates
// ------------------------------------------------------------

randomNumberGenerator = d3Random.randomBates(3);

// ------------------------------------------------------------
// randomIrwinHall
// ------------------------------------------------------------

randomNumberGenerator = d3Random.randomIrwinHall(3);

// ------------------------------------------------------------
// randomExponential
// ------------------------------------------------------------

randomNumberGenerator = d3Random.randomExponential(1 / 40);
github DefinitelyTyped / DefinitelyTyped / d3-random / d3-random-tests.ts View on Github external
randomNumberGenerator = d3Random.randomLogNormal();
randomNumberGenerator = d3Random.randomLogNormal(3);
randomNumberGenerator = d3Random.randomLogNormal(3, 4);

// ------------------------------------------------------------
// randomBates
// ------------------------------------------------------------

randomNumberGenerator = d3Random.randomBates(3);

// ------------------------------------------------------------
// randomIrwinHall
// ------------------------------------------------------------

randomNumberGenerator = d3Random.randomIrwinHall(3);

// ------------------------------------------------------------
// randomExponential
// ------------------------------------------------------------

randomNumberGenerator = d3Random.randomExponential(1 / 40);
github nteract / semiotic / src / docs / components / CreatingXYPlots.js View on Github external
import * as React from "react"
import { XYFrame } from "../../components"

import DocumentComponent from "../layout/DocumentComponent"
import { randomNormal } from "d3-random"
import { scaleThreshold } from "d3-scale"
import { hexbinning, heatmapping } from "../../components/svg/areaDrawing"

// eslint-disable-next-line

const components = []
const pointTestData = []
const nRando = randomNormal(0, 1000)
const pRando = randomNormal(0, 1000)

const steps = ["none", "#FBEEEC", "#f3c8c2", "#e39787", "#ce6751", "#b3331d"]
const thresholds = scaleThreshold()
  .domain([0.01, 0.25, 0.5, 0.75, 1])
  .range(steps)

for (let x = 1; x < 100; x++) {
  pointTestData.push({
    x: nRando() * 2 - 3000,
    y: 2000 + nRando(),
    color: "#00a2ce"
  })
}
for (let x = 1; x < 100; x++) {
  pointTestData.push({