Embed a Collection?

Is it possible to embed a collection (thumbnails) in a notebook, so it is automatically updated?

I would like to achieve something like this: https://observablehq.com/@d3/gallery but instead of hard coding all the notebook references, specify a single Collection reference.

1 Like

Hi @austingoudge! Unfortunately no, embedding collections is not something we currently support.

However, one could build a hacky workaround using our internal API - whipped up a little example here. It will only work for public collections, and the API isn’t intended to be used that way so we can’t guarantee its stability - but hopefully this might be helpful for your use case.

In any case we’ll take this into account as a feature we might want to support down the line. Thanks a lot for raising the question, and let me know if you have any questions about the hacky example!

3 Likes

And if you don’t feel like theming, here are some helpers to render notebook thumbnails from an API response (or completely custom):

(Note that they currently mimic an older Observable style.)

Edit: Applied to Anjana’s notebook the result would look like this:

3 Likes

Thank you both, that’s an excellent hack. It will work very well until embedding collections is natively supported.

1 Like

Hi everyone! Is there any update to this feature request? We’d like to do the same thing…

(and also, a lot of ppl have bookmarked Austin’s workaround notebook Gallery / D3 / Observable)

@terezaif did a live one using fetchp (and it’s awesome!)

1 Like