Published
Edited
Oct 13, 2020
Insert cell
Insert cell
Insert cell
d3.transpose(table).map(d => d.join(" "))
Insert cell
table = {
const table=[];
samples.forEach((d,i)=>{
table[i]=rgb_value(d)
})
return table;
}
Insert cell
function rgb_value(raw){
const {r, g, b} = d3.color(raw)
return [r / 255, g / 255, b / 255]
}
Insert cell
samples={
const color = d3.interpolateViridis
return d3.range(5).map(d => color(d / 4))
}
Insert cell
d3 = require("d3@6")
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