Skip to content

Commit 04e580a

Browse files
committed
scope rng for repeatable output
1 parent e5187bf commit 04e580a

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

test/plots/identity-scale.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import * as Plot from "@observablehq/plot";
22
import * as d3 from "d3";
33

4-
const random = d3.randomLcg(42);
5-
64
export default async function() {
5+
const random = d3.randomLcg(42);
76
return Plot.plot({
87
x: {
98
type: "identity"

test/plots/random-walk.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import * as Plot from "@observablehq/plot";
22
import * as d3 from "d3";
33

4-
const randomNormal = d3.randomNormal.source(d3.randomLcg(42))();
5-
64
export default async function() {
5+
const randomNormal = d3.randomNormal.source(d3.randomLcg(42))();
76
return Plot.plot({
87
marks: [
98
Plot.lineY(d3.cumsum({length: 500}, randomNormal), {stroke: "red"}),

test/plots/uniform-random-difference.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import * as Plot from "@observablehq/plot";
22
import * as d3 from "d3";
33

4-
const random = d3.randomLcg(42);
5-
64
export default async function() {
5+
const random = d3.randomLcg(42);
76
return Plot.plot({
87
x: {
98
label: "Difference of two uniform random variables",

0 commit comments

Comments
 (0)