Published
Edited
Oct 4, 2022
1 star
Insert cell
Insert cell
Insert cell
Insert cell
dino = FileAttachment("datasaurus.csv").csv({typed: true})
//toda a base de dados
Insert cell
dinozinho = dino.slice(0*142+1,(0+1)*142)
//slicing somente os dados que formam o dinossauro.
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
now = dino.slice(t*142+1,(t+1)*142)

//slicing de cada um, o t muda com o tempo
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
t_2 = {
for (let t = 0; t < 1000; ++t) {
yield Promises.tick(3000, t);
}
}
Insert cell
t_anim_2 = {
t_2
for (let t = 0; t < 142; t = t+2) {
yield Promises.tick(2, t);
}
}
Insert cell
now_time_2 = {
dino.slice(t_k*142+1,(t_k+1)*142)
if (t_2%3 == 0){
var t_k = t_2;
yield dino.slice(t_k*142+1,(t_k+1)*142).slice(0,t_anim_2);
}
else if (t_2%3 == 1){
var t_k = t_2-1;
yield dino.slice(t_k*142+1,(t_k+1)*142).slice(0,142);
}
else {
var t_k = t_2;
var t_k = t_2-2;
yield dino.slice(t_k*142+1,(t_k+1)*142).slice(t_anim_2,141);
}
}
Insert cell
Insert cell
import {howto, altplot} from "@d3/example-components"
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