Published
Edited
Aug 25, 2020
Importers
Insert cell
md`# Math Utils`
Insert cell
function roundLog(x, base = 10) {
const logX = Math.ceil(Math.log(x) / Math.log(base));
return Math.pow(base, logX);
}
Insert cell
{
const x = Math.random() * 1000;
return [x, roundLog(x, 2), roundLog(x, 10)];
}
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