Interactive JFM figures that run entirely in the reader's browser
These are the vortex structures from a published JFM Notebook. The notebook itself runs here unmodified: k3d, scipy.io.loadmat and numpy. It runs on Sagebrush, a Python and Sage environment compiled to WebAssembly. Nothing is computed on a server. The page loads the published data, builds a mesh of half a million triangles, and you can turn it, zoom into it, and fly through it.
U vortices
495,026 triangles colored by the published attribute (color range ±50, the seismic color map).
The figures of “Introducing JFM Notebooks”
The notebooks of Meneveau & Caulfield, J. Fluid Mech. 952, E1 (2022), as published, run here unchanged. Each loads its data from the article's supplementary material and draws its figure in the page. Change a parameter and run it again.
Figure 1: mean velocity
DNS of turbulent channel flow at Reτ = 1000 and 5200 against the composite model. Try other values of κ, B and c₁.
Figure 3: stratified shear flow
Density in three simulations at four times: 12 filled-contour panels from 75 MB of data (Lewin & Caulfield 2022). Try another colormap or range.
Figure 2 of the article is a screenshot of figure 1's notebook. The notebooks and data are the article's supplementary material (CC BY 4.0).
Moving around
- Turn: drag. A flick keeps it spinning.
- Pan: right-drag or shift-drag, or drag with two fingers.
- Zoom toward the cursor: scroll, or pinch.
- Examine a detail: double-click a vortex to glide in and orbit it. Double-click empty space to go home.
- Fly through the flow: press F or the Fly button. Click to look around with the mouse, and press Esc to release it.
- W A S D move, Space/Q rise and sink, Shift is faster, and the wheel sets the speed. A gamepad works too.
- Turntable: T. Full screen: the toolbar at the bottom left.
Why this matters for publishing
- The reader's own device does the work. No kernel and no server process is started for each reader, so a figure costs the publisher a static file and nothing more. It loads quickly anywhere, and a downloaded 3D view works offline.
- The published notebook is the figure. “Run the notebook” opens the article's own
.ipynbwith its data and executes it in the page. In a few seconds the reader can change the color range, the colormap or the threshold and rerun it. - Archival and open. The 3D view is one self-contained HTML file with the data inside. It has a static image and a text description for readers and tools that do not run scripts. Sagebrush is open source (MIT or Apache-2.0).
- It scales to a whole collection. The same runtime can serve every notebook in the series. We plan to run all of them.