Skip to content

Read the map

What each tab of the page shows. The page is three tabs, with the entry point and the folder at the right of them.

The tabs

Tab Tells you
Graph The paths: what comes in, who calls whom, and what it reaches
Decisions Each question the code asks, and where each answer goes
Step by step Every line that matters, in the order it runs

The graph

Read it left to right.

Column What's there
Comes in What the code gets: its input, env vars
Entry Where it starts, plus what runs at import
Calls Your functions. Further right means deeper
Reaches AWS services, the services its libraries reach (Redis, PostgreSQL, OpenAI), and the web

A code-node graph A code-node graph

Inside a function's box

A function's box lists what it does, top to bottom in the order its code does it: each call to your own functions, each AWS or library call, and each HTTP request, one numbered row each. The arrow for a call leaves from its row, and the boxes it calls are stacked in the same order, so you can read down the box and across to the next column.

In a row Means
Indented Inside a loop or an if in this function
↻ In a loop: once per item
if Only sometimes: point at the row for the test
Dimmed A function not drawn here: click it to open the calls
SQLite SELECT (+2) Three calls in a row to one service, the same way
+4 more Calls left out of the box: Open its calls › draws them all

Arrow colours

Arrow Means
━━ grey calls
━━ blue reads
━━ orange writes
━━ pink sends, or an HTTP call (dashed)
╍╍ dashed an env var
↻ happens in a loop
● amber a warning is about it, such as an HTTP request with no timeout

Worth knowing

Point at a box and everything not on a path through it fades out: what calls it, all the way up to the entry point, and what it calls and reaches, all the way down. Point at S3 or a database to see every path that gets there. Click a box and its paths stay lit while its code is open.

Zoom, full screen and big graphs

The graph sits in a box of one size, about the window's height, and is drawn at its real size. Auto shrinks it a little to fit the page's width; Fit puts all of it in the box; 100% and 150% are as big as it is and bigger. Full screen gives it the whole window, with the same buttons. Move about it as on a canvas: drag it to pan, hold Ctrl (⌘ on a Mac) and scroll, or pinch a trackpad, to zoom around the pointer, and with the graph focused +, - and 0 (back to Auto). The − and + in its bottom-right corner zoom too, around how big it's drawn. Arrows that skip columns from one box (the environment's, start-up's) or into one run as a single line and part near the end, and a column too tall to take in is split into lanes side by side, so --functions 100 draws a wide map rather than a long strip.

Click a box to read its code

A panel slides in from the right, over the graph, with the code the box is about, its lines numbered. A function shows whole, with the lines that make the calls its arrows show lit in amber. An AWS service, the web, the environment, the input and At import show a few lines around each place the code uses them. When the folder is in git, each line of a function says who changed it last and how long ago, and pointing at one puts its commit in the panel's last row; the gear by × turns that off. Close it with ×, Escape, a click anywhere outside it, or the browser's Back button. Without JavaScript, × and Back still close it.

Open the calls a box leaves out

A box whose calls aren't drawn ends with Open its calls › in blue, and its rows for them are dimmed. Click either and the graph starts from that function, with every call it makes, in order, and whatever they reach. The line over the graph is the path down to it from the entry point: click a name in it to go back up, or the browser's Back button. All in the graph's bar draws every function at once. This is the one part of the page that needs JavaScript; without it the link isn't shown, and the Step by step tab has every call.

Decisions

The second tab draws each call as a flowchart, top to bottom, so you can see what decides which way the code goes.

It starts with what comes in and the entry point, then has a box for each line that does something, in the words Step by step uses ("Takes bucket, key from the event"). A call into one of the code's own functions is a box listing what it reaches, with the graph's logos.

Shape Is
Box pointed at both ends An if: the test, with yes and no on its two arrows. An elif is the next question on the no arrow, and so is each case of a match
Dashed box with an arrow back to its top A loop: its lines, and the arrow back for the next item ("next order")
Dashed amber arrow Out of a try, to what runs when a line in it raises
Black pill Where the call returns
Red pill Where it raises
Dashed purple pill continue or break: skips to the next item, or leaves the loop

The answer that goes on runs down the middle, and one that ends early (returns, raises, skips to the next item, leaves the loop) sits beside it, so the usual path reads as one line. if not check(order): continue is asked as check(order)?, with yes going on and no skipping to the next order.

The Decisions tab The Decisions tab

Calls that decide things too

A call to one of the code's own functions that makes decisions of its own is opened in place: a box with its name, holding its flow, whose returns go back to the caller. Past two calls deep, or when it would be very tall, it's a box that says how many decisions are inside, and links to its flow under the first one. A web app has a flow for each of its routes, each starting with its method and path.

Worth knowing

Point at a box, a question or an end to see the line of code it's for.

Step by step

The third tab walks through the code in the order it runs, as a debugger steps through it.

The list on the left has every line that does something, each said in a few plain words ("Takes bucket from the event", "Reads from S3 (GetObject)"): what runs when Python imports the code, then each call from the entry point, with each of its own functions as a heading over its steps. A dot marks the steps that reach AWS or the web, in the graph's colours. On the right is a card saying what the current step does and which calls it's inside, and under it the function's code with that line lit.

The list is a tree, like a JSON viewer's: the arrow beside a step with steps under it (a function, a loop, a branch) folds them away and leaves a count in their place, so you can hide what you've read and keep the part you're following. A folded step still shows its card and code when Next lands on a step inside it.

The Step by step tab The Step by step tab

Button Goes to
Next The next line that runs, into a function when the line calls one
Back The step before
Skip call The next line in the same function, past what the line calls (a debugger's step over)
Finish Where the function returns to (step out)

Worth knowing

Click a step, in the list or a numbered line in the code, then use the arrow keys to step through the rest.

How it works without JavaScript

Each step is a radio button and the buttons are its labels, so the arrow keys move between them as they do in any radio group. The CSS shows the card of the checked step and the code of the function it's in, and moves the lit line there, which slides when the next step is in the same function. Each fold is a checkbox, and the steps under it carry its number as a class, so one rule hides them all.