Published
Edited
Nov 8, 2019
1 fork
Insert cell
md`# D3 Tutorial 13-3`
Insert cell
dataset = [ 5, 10, 13, 19, 21, 25, 22, 18, 15, 13,
11, 12, 15, 20, 18, 17, 16, 18, 23, 25 ];
Insert cell
w = 500
Insert cell
h = 100
Insert cell
svg = {
const svg = DOM.svg(w, h)
d3.select(svg).selectAll("rect")
.data(dataset)
.enter()
.append("rect")
.attr("x", function(d, i) {
return i * (w / dataset.length);
})
.attr("y", 0)
.attr("width", 20)
.attr("height", 100);
return svg
}
Insert cell
style = html`<style>
</style>`
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