Is the cell flow model to write everything bottom to top?

Looking at this one Scatterplot Matrix / D3 / Observable

Seems like everything is backwards? With the imports at the bottom? Is this really how it is done? If so, why is this not one of the first things in the intro?

Am trying to figure out how to just treat these things more like code and copy/paste flow them but it seems like there must be some kind of execution order or is everything just fired off at once and nothing matters in terms of ordering?

The cells run in a so-called topological order so you can place them in any order you like. It does seem to be common practice for folks to write things bottom to top. I think the objective is to focus the reader’s attention on the output first.


You can put your cells in whatever order you think helps yourself or your reader. You can open the Minimap from the right sidebar to see what order cells run in. I made a quick video for you: