A little note about Elm Notebook. The goal of the project is to provide something akin to Jupyter Notebooks, but for Elm: an app with cells in which you can put both text and code, and where code in a cell can be executed, producing output of various kinds — text, image, chart, animation, etc. The engine that makes everything work is elm-interpreter by @minibill (Leonardo Taglialegne).
Elm notebook is work-in-progress with various bugs, lacunae, and rough spots. It will no doubt change a lot. I look forward to your suggestions and to making the app something that everybody in the community can profit from. I’ve thought of it mainly as a teaching tool. Here’s the code: github.com/jxxcarlson/elm-notebook.
Below are three examples of what one can do as of this writing.
1. First, a cell with some pure Elm code. It produces text output.
2. Next, a cell with some Elm code that defines a list
b of Svg images and another cell which renders
the content of
3. Finally, a cell which draws a scatter plot and regression line for the data from Edwin Hubble’s
1929 paper on the correlation between the speed at which galaxies are moving
away from Earth versus their distance from us. This is the first experimental evidence
establishing the fact that the universe is expanding. The code you see below is a little interface to Tereza Sokol’s elm-charts.
The data in question was uploaded from a CSV file and stored in
hubble for later use. The syntax of the
chart command is
chart KIND OPTIONS SOURCE where KIND is line, scatter, bar, etc., OPTIONS is a possibly empty list of items that can appear in any order, and SOURCE is the name of the persistent variable in which the data is stored.
You can try out the public notebooks without signing in to the app. For example, for the beacon animation, follow this link: elm-notebook.lamdera.app/p/beacon. Just read the directions in the top cell to run the animation.
You will also see a list of public notebooks. Click on any one to try it out. To create or modify notebooks, you will need to sign in.
PS. Another thing to try out is elm-notebook.lamdera.app/p/random. It is a simulation of 2D random walk (Brownian motion). Below is a screenshot of one run of this notebook. It describes the 5000-step history of a random walker who began his journey at the center of the translucent red disk.
Note 1. (7/18/2023) I’ve added some crude error messages. It will likely be a good while before they get much better.
Note 2. (7/19/2020) Evaluation of expressions in a cell no longer depends on the order of the cells or the order of the declarations (definitions) within a cell. In addition, cells can now have more than one expression, as illustrated below.
Note 3.(7/29/2023) I’ve made some esthetic changes, squashed a bug or two … see below