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

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