Published
Edited
Sep 26, 2022
1 star
Insert cell
Insert cell
Insert cell
two.bind('update', (framecount) => {
group.translation.set(two.width/2 + (two.width/2 - 100) * Math.sin(framecount/60) + 50, two.height/2)
group.scale += 0.05*Math.cos(framecount*0.1)
}).play()
Insert cell
group = {
const g = two.makeGroup(circle, square)
g.noStroke()
return g
}
Insert cell
square = {
const r = two.makeRectangle(-100, 0, 100, 100)
r.fill = "#00b4ff"
two.clear()
return r
}
Insert cell
circle = {
const c = two.makeCircle(0, 0, 50)
c.fill = "#FFe2a5"
two.clear()
return c
}
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.
Learn more