Skip to main content
Alkera notebooks are reactive. Each cell knows which names it defines and which names it reads, so the notebook forms a dependency graph. Change an input or a query, and the cells that depend on it re-run. A result on screen always matches the code above it. There is no hidden state from running cells out of order, because the order cells run in comes from the graph, not from their position on the page.

How the graph is built

Alkera reads each cell’s code to find:
  • Definitions: the variables, functions, and imports the cell creates.
  • References: the names it reads that another cell defines.
A cell that reads orders depends on the cell that defines orders. SQL cells take part too. A SQL cell’s result name is a definition, and a DuckDB query that selects from a dataframe is a reference to it. In the gutter beside each cell, ↑ and ↓ counts show how many cells it reads from and how many read it. Hover to highlight them, and click to jump there.

Rules that keep the graph sound

  • Each name is defined in one cell. If two cells define the same name, both are flagged, and the cell offers to make the name local to that cell or to rename it.
  • Cells can’t depend on each other in a loop. Cells in a cycle are flagged and do not run.
  • Names that start with an underscore are local to their cell, so _tmp in one cell does not clash with _tmp in another.

Run modes

Choose how the notebook reacts in Settings (the gear in the toolbar), under When a cell runs. Lazy mode is useful when downstream cells do something expensive, such as a slow computation or a query against a billed warehouse. When a run would take a long time, Alkera asks first with Run these cells? and an estimated time.

Cell status

The dot in each cell’s gutter shows its state.

Run controls

The toolbar has Run all, Run stale, and Interrupt. The Kernel menu adds Restart, Restart and run all, Interrupt and clear the queue, Shut down, and Clear all outputs. Each cell’s ⋯ menu adds Run above and Run below.

See the whole graph

Open Panels in the toolbar and choose Graph to see the notebook’s dependency graph. Filter it to a cell’s Upstream or Downstream to see what feeds it and what it affects. Variables lists every name the notebook defines and jumps to the cell that defines it. Outline lists the notebook’s Markdown headings.

Widgets drive reactivity

Interactive widgets such as sliders and dropdowns are values in the graph. Move a slider and every cell that reads it re-runs. See widgets.

SQL and Python

How SQL results join the graph.

Outputs and charts

Widgets and the outputs they drive.