Published
Edited
Nov 1, 2019
Insert cell
md`# D3 Tutorial 07-4`
Insert cell
dataset = [ 5, 10, 15, 20, 25 ]
Insert cell
div = html`<div></div>`
Insert cell
d3.select(div).selectAll("p")
.data(dataset)
.enter()
.append("p")
.text(function(d) { return d; })
.style("color", function(d) {
if (d > 15) { // 15 が区切り
return "red";
} else {
return "black";
}
});
Insert cell
d3 = require('d3@5')
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