Public
Edited
Apr 11, 2024
Insert cell
Insert cell
p5((s) => {
s.setup = function () {
s.createCanvas(width, height);
s.frameRate(8);
s.textSize(22);
};

s.draw = function () {
s.background(255, 255, 255, 60);
s.noStroke();
s.fill(s.random(150), s.random(150), s.random(150));

let x = 200 * s.sin(s.frameCount * 0.1) + 220;
let y = height - 40;

let source = [0, 0, width, height];
let target = [0, -20, width, height];

s.copy(s, ...source, ...target);
s.text(data.sample().text.slice(0, 100) + "...", x, y);
// s.circle(x, y, 25);
};
})
Insert cell
p5((s) => {
s.setup = function () {
s.createCanvas(width, height);
s.frameRate(10);
s.textSize(fontSize);
};

s.draw = function () {
s.background(255, 255, 255, 20);
s.fill(0);
s.noStroke();

s.textAlign(s.LEFT);

//let x = s.frameCount % width;
//let y = 200 * s.sin(x * 0.1) + height / 2;

let y = (fontSize * 2 * s.frameCount) % height;
let x = width / 2 * s.sin(y * 0.01) + width / 3;

//s.circle(x, y, 25);
s.text(data.sample().text, x, y);
};
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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