Public
Edited
Oct 26, 2023
3 forks
104 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
map = new Map([["foo", 1], ["bar", 2]]) // creates a Map
Insert cell
// creates elements from a Map
circles = d3
.create("svg")
.selectAll("circle")
.data(map)
.join("circle")
Insert cell
circles.size()
Insert cell
// creates a Map from a selection’s data
new Map(circles.data())
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
// markdown with yellow and pink highlights
mdh = {
const hljs = window.hljs || (await require("@observablehq/highlight.js"));

return function() {
const node = md(...arguments);
for (const fragment of node.querySelectorAll("code")) {
hljs.highlightBlock(fragment);

fragment.innerHTML = fragment.innerHTML.replace(
/___(.*?)___/g,
'<mark>$1</mark>'
);
fragment.innerHTML = fragment.innerHTML.replace(
/~~~(.*?)~~~/g,
'<mark style="background:pink">$1</mark>'
);
}

return node;
};
}
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