Platform
Resources
Pricing
Sign in
Get started
D3
Bring your data to life.
Workspace
Fork
Public
d3-random
By
Fil
Edited
Oct 24, 2023
ISC
5 stars
d3-random
d3.randomLcg
Random Probability Plots
d3-random
random.source
Insert cell
Insert cell
Insert cell
Insert cell
{
const
seed
=
0.25160386911120525
;
// a number in [0,1)
const
source
=
d3
.
randomLcg
(
seed
)
;
const
random
=
d3
.
randomNormal
.
source
(
source
)
(
0
,
1
)
;
return
Array
.
from
(
{
length
:
8
}
,
random
)
;
}
Insert cell
Insert cell
alea
=
require
(
"seedrandom@3/lib/alea.min.js"
)
Insert cell
{
const
source
=
alea
(
seed
)
;
const
random
=
d3
.
randomNormal
.
source
(
source
)
(
0
,
1
)
;
return
Array
.
from
(
{
length
:
8
}
,
random
)
;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
randomCrypto
=
(
)
=>
crypto
.
getRandomValues
(
new
Uint32Array
(
1
)
)
[
0
]
/
4294967295
Insert cell
Array
.
from
(
{
length
:
8
}
,
d3
.
randomNormal
.
source
(
randomCrypto
)
(
0
,
1
)
)
Insert cell
Insert cell
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Try it for free
Learn more
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Show 2 comments
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
alea
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
seed
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
randomCrypto
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML