Public
Edited
Nov 16, 2023
Fork of Star map
Insert cell
Insert cell
Insert cell
Insert cell
colR = d3.interpolateYlOrRd //d3.interpolateViridis //d3.interpolateOrRd
Insert cell
cols = Array.from({ length: nbCl }, (_, i) => colR(i / (nbCl - 1)))
Insert cell
col = d3.scaleQuantile().range(cols)
Insert cell
colIni = (cells, r, zf) => {
col.domain(cells.filter((c) => c.ind).map((c) => c.ind));
return col;
}
Insert cell
color = (c, colInfo) => colInfo(c.ind)
Insert cell
style = new gviz.Style({
drawFun: (cells, r, cg) => {
const colInfo = colIni(cells, r);

cg.setCanvasTransform();
for (let c of cells) {
cg.ctx.fillStyle = color(c, colInfo);
cg.ctx.fillRect(c.x, c.y, r, r);
}
}
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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