Published
Edited
Feb 24, 2022
1 fork
3 stars
Insert cell
Insert cell
Insert cell
viewof numCirles = slider({ min: 1, max: 10, value: 2, step: 1 })
Insert cell
viewof frequency = slider({ min: .01, max: 5, value: .3 })
Insert cell
viewof amplitude = slider({ min: 1, max: 100, value: 10 })
Insert cell
viewof speed = slider({ min: .5, max: 5, value: 1 })
Insert cell
baseR = 120
Insert cell
Array.from({ length: numCirles })
Insert cell
line = i =>
d3
.lineRadial()
.angle(d => d)
.curve(d3.curveCardinalClosed)
.radius(
d =>
baseR +
rScale(
simplex.noise3D(
Math.cos(d * i) * frequency,
Math.sin(d * i) * frequency,
// i + 3
(i * now) / 5500
)
)
)
// .radius(d => baseR + rScale(simplex.noise2D(d * i * frequency, now / 5500)))
Insert cell
rScale = d3
.scaleLinear()
.domain([0, 1])
.range([-amplitude, amplitude])
Insert cell
height = 500
Insert cell
circleSegments = 60
Insert cell
data = Array.from(
{ length: circleSegments },
(d, i) => (i / (circleSegments + 1)) * 2 * Math.PI
)
Insert cell
simplex = new noise()
Insert cell
Insert cell
Insert cell
noise = require("simplex-noise@2")
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.
Learn more