Published
Edited
Aug 7, 2020
3 stars
Insert cell
Insert cell
2 * 3 * 7
Insert cell
{
let soma = 0;
for (let i = 0; i <= 100; ++i) {
soma += i;
}
return soma;
}
Insert cell
Insert cell
cor = "red"
Insert cell
`Minha cor preferida, em inglês, é ${cor}.`
Insert cell
Insert cell
html`<span style="background:yellow;">
Minha linguagem preferida é <i>HTML</i>.
</span>`
Insert cell
Insert cell
md`Minha linguagem preferida é *Markdown*.`
Insert cell
Insert cell
html`Minha cor preferida, em inglês, é <i style="background:${cor};">${cor}</i>.`
Insert cell
Insert cell
status = new Promise(resolve => {
setTimeout(() => {
resolve({resolvido: new Date});
}, 2000);
})
Insert cell
Insert cell
status
Insert cell
Insert cell
d3 = require("d3-fetch@1")
Insert cell
Insert cell
países = (await d3.tsv("https://cdn.jsdelivr.net/npm/world-atlas@1/world/110m.tsv"))
.sort((a, b) => b.pop_est - a.pop_est) // Ordena a população estimada, de forma decrescente.
.slice(0, 10) // Pegue os dez maiores.
Insert cell
Insert cell
i = {
let i = 0;
while (true) {
yield ++i;
}
}
Insert cell
`O valor atual de i é ${i}.`
Insert cell
Insert cell
data = {
while (true) {
yield new Promise(resolve => {
setTimeout(() => resolve(new Date), 1000);
});
}
}
Insert cell
Insert cell
controleDeslizante = html`<input type=range>`
Insert cell
valorControleDeslizante = Generators.input(controleDeslizante)
Insert cell
Insert cell
viewof valor = html`<input type=range>`
Insert cell
valor
Insert cell
Insert cell
import {viewof selection as carros} from "@d3/brushable-scatterplot"
Insert cell
viewof carros
Insert cell
carros
Insert cell
md`${Array.from(new Set(carros.map(c => c.name)))
.sort()
.map(c => `* <a target="_blank" href="https://google.com/search?tbm=isch&q=${escape(c)}">${c}</a>`)
.join("\n")}`
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