For graphics-based notebooks that make heavy use of random number generators / noise, or are slow to render, it would be cool if we could supply a link to a canned thumbnail (which does not display in the notebook itself), rather than relying on the thumbnail daemon (it would prevent needless repeated notebook updates in a futile attempt to appease the PRNG gods, and other shenanigans).
Totally. Weāve even occasionally resorted to directly overwriting our notebooksā thumbnails in the database ourselves!
Itās on the wish list.
Sorry for the troubleāthe thumbnail daemon isnāt as reliable (nor are the results as beautiful) as weād like. Weāve got some improvements planned and weāll keep you posted as weāre able to implement them.
One thing Iāve noticed is that some of the first-party notebooks use images at the top which are larger or differently shaped than ideal for readability of the notebook itself, Iām guessing to make the thumbnail work out properly. Some peopleās notebooks seem to have been especially tweaked for the purpose of getting the thumbnail to look nice, and some notebooks where there was no explicit effort put in have quite bad thumbnails as a result.
Maybe if thereās a cell labeled āthumbnailā anywhere in the notebook (e.g. at the bottom) the thumbnail daemon could default to using that one? Then in problem cases (e.g. a notebook requiring expensive computation of its interesting drawings) a pre-rendered image can be stuck in there explicitly.
The thumbnail daemon selects the first image, SVG or Canvas element that is at least 320px wide and 200px tall. If there is no such element, then the top part of the notebook is used (immediately below the title). When we improve our publishing flow, we plan on offering greater control over the thumbnail, as well as the title and slug.
Is there some context that allows to determine that the notebook is run by the thumbnail daemon?
Yup, the user agent string. Iāve created a demo here: Custom Notebook Thumbnail / Fabian Iwand | Observable
@mootari Just saw your notebook -
That was smart workaround
Unfortunately it relies on the (default) user agent string, which could change at any point.
@mbostock Please donāt change it? Pretty please? Or standardize it instead?
The user agent string will likely change in the next few months when we get better unicode support, better looking native inputs, and other improvements to thumbnails - but weāre also planning on making an explicit and reliable way to customize thumbnails and weāll likely do both at the same time.
@mbostock The āfirstā meaning the first rendered or the first cell from top to bottom?
Iāve got a map that Iād like to be the thumbnail ā and it is first (top to bottom) but the (boring) bar chart gets thumbnailed for some reason. Iām guessing because it gets rendered first.
The first in document order, as in top-to-bottom.
Iām not sure why the bar chart is getting selected in that notebook. Our thumbnail daemon isnāt great with WebGL (and⦠many other non-trivial things), or it may be the thirty-second timeout.
We have plans to ship a better thumbnail daemon, and we also want you to be able to select a thumbnail explicitly when publishing. But neither of those features are our highest priority right now, so you might have to put a static hero image at the top of your notebook if you want to guide the thumbnailer in the right direction in the interim.
@mbostock I can understand that tweaking the thumbnail feature, which usually works great, is a lower priority. Iāll figure something out. Thanks for the quick response.