Public
Edited
Oct 28, 2022
Insert cell
Insert cell
Insert cell
dataset = [5, 25, 45, 65, 85]
Insert cell
Insert cell
{
const div = d3.create('div')
return div.selectAll('p')
}
Insert cell
Insert cell
div = {
const div = d3.create('div')
div.selectAll('p')
.data(dataset)
.join('p')
.text('新しいパラグラフ')
return div.node()
}
Insert cell
Insert cell
d3.select(div).selectAll('p')
Insert cell
div3 = {
const div = d3.create('div')
div
.selectAll('p')
.data(dataset)
.join('p')
.text(function(d) {return d})
.text((d,i) => `${i+1}人目は、${d}点!`)
.style("color", (d)=> {
if (d <= 30) {
return "green"
}else{
return "black"
}
})
.style("background-color", (d,i) =>
(i%2 == 0 ? "pink": "yellow")
)
return div.node()
}
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