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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more