Published
Edited
Oct 5, 2022
2 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
dog_data = {
let dogZip = await FileAttachment("Dog_Photos@3.zip").zip();
let breeds = d3
.sort(
(await dogZip.file("Readme.txt").text())
.split("\r")
.slice(3, -1)
.map((s) => s.split("\t")),
(a) => a[0]
)
.map((a) => a[1]);
let urls = await Promise.all(
dogZip.filenames
.filter((f) => f.slice(-4) == ".jpg")
.map(async function (name, i) {
return dogZip.file(name).url();
})
);
return d3.zip(breeds, urls).map((a) => ({ breed: a[0], url: a[1] }));
}
Insert cell
tippy_style = html`<div style="display: none"><link rel="stylesheet" href="${await require.resolve(
`tippy.js/themes/light.css`
)}"></div>`
Insert cell
tippy = require("tippy.js@6")
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