Public
Edited
Jun 11
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
viewof selectedBlockId = {
let currentValue = null;

const div = html`<div></div>`;
div.value = currentValue;
div.oninput = () => {
currentValue = div.value;
};

return div;
}
Insert cell
viewof featureMapIndex = {
let currentIndex = 0;

const div = html`<div></div>`;
div.value = currentIndex;

div.oninput = () => {
currentIndex = div.value;
};

return div;
}
Insert cell
function darkenColor(hex, factor) {
hex = hex.replace("#", "");
const r = parseInt(hex.substring(0,2),16);
const g = parseInt(hex.substring(2,4),16);
const b = parseInt(hex.substring(4,6),16);
const rD = Math.floor(r * factor);
const gD = Math.floor(g * factor);
const bD = Math.floor(b * factor);
return "#" + [rD,gD,bD].map(x => x.toString(16).padStart(2, "0")).join("");
}
Insert cell
zip = FileAttachment("google://vis.zip").zip()
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