Platform
Resources
Pricing
Sign in
Get started
Jonathan Helfman
Student of math, d3, svg, etc. Prototyper of visualizations for electronics design and test.
Workspace
Fork
Public
By
Jonathan Helfman
Edited
Jul 5, 2023
Importers
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
seed
=
useSeed
?
0.314
:
undefined
Insert cell
function
makeSimplex1D
(
seed
,
smoothness
=
20
)
{
const
simplex
=
new
SimplexNoise
(
seed
)
;
const
simplexNoise1D
=
(
n
)
=>
simplex
.
noise2D
(
n
/
smoothness
,
10
)
;
// use a closure to hide required incrementing parameter
let
i
=
0
;
function
noise1D
(
)
{
return
simplexNoise1D
(
i
++
)
;
}
return
noise1D
;
}
Insert cell
Insert cell
simplex1D
=
(
smoothness
=
20
)
=>
{
const
source
=
(
seed
)
=>
makeSimplex1D
(
seed
,
smoothness
)
;
const
gen
=
makeSimplex1D
(
d3
.
randomUniform
(
)
(
)
,
smoothness
)
;
gen
.
source
=
source
;
return
gen
;
}
Insert cell
test
=
simplex1D
(
)
.
source
(
0.123
)
Insert cell
test
(
)
Insert cell
data
=
{
const
f
=
makeSimplex1D
(
seed
,
sx
)
;
return
d3
.
range
(
n
)
.
map
(
(
d
)
=>
f
(
)
)
;
}
Insert cell
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
n
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
sx
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
useSeed
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
seed
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
makeSimplex1D
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
simplex1D
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
test
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
data
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
SimplexNoise
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML