Public
Edited
Feb 14, 2024
1 fork
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
slug = {
//remove leading slash
if (providedslug.startsWith("/")) return providedslug.substr(1);
//add "d/" if only the number is provided
if (/^[0-9a-f]{16}$/.test(providedslug)) return `d/${providedslug}`;
//remove the base url if the whole url is provided
if (providedslug.startsWith("https://observablehq.com/"))
return providedslug.replace("https://observablehq.com/", "");
return providedslug;
}
Insert cell
Insert cell
Insert cell
Insert cell
unversionedslug = slug.replace("@" + version, "")
Insert cell
usedslug = pinned == "Latest published version" ? unversionedslug : slug
Insert cell
url = slug ? `https://api.observablehq.com/${slug}.js?v=3` : null
Insert cell
notebookUrl = slug ? `https://observablehq.com/${slug}` : null
Insert cell
Insert cell
Insert cell
Insert cell
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