Published
Edited
Sep 13, 2022
1 fork
1 star
Insert cell
Insert cell
Masonry = require("https://bundle.run/masonry-layout@4.2.2")
Insert cell
imagesLoaded = import("https://cdn.skypack.dev/imagesloaded@5.0.0?min").then(
(d) => d.default
)
Insert cell
Insert cell
Insert cell
{
button;
const image = d3.shuffle([...images]).pop();
grid.appendImage(image);
}
Insert cell
style = html`
<style>
.grid {
background: #DDD;
}

/* clear fix */
.grid:after {
content: '';
display: block;
clear: both;
}

.grid-sizer,
.grid-item {
width: ${itemWidth}px;
}

.grid-item {
float: left;
}

.grid-item img {
display: block;
max-width: 100%;
}
</style>`
Insert cell
itemWidth = 160
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