Skip to content

Folders and notes

A folder groups the statements written inside it. Desmos supports one level, so folders do not nest. Inside one a statement ends at its newline, exactly as it does at the top level; a ; separates two written on one line.

examples/05-folders-and-notes.axis

config {
expressionsCollapsed: false
}
"Folders group a long graph into readable sections."
folder "Open by default" {
"A note inside a folder is an entry like any other."
y = sin(x) @ color: RED
y = cos(x) @ color: BLUE
}
// Metadata written straight after the { is the folder's own: collapsed starts
// it shut.
folder "Closed by default" { @ collapsed
y = sin(2x) @ color: GREEN
y = cos(2x) @ color: PURPLE
}
// A folder can hold the working parts of a construction, hidden away.
folder "Working values" { @ collapsed
amp = 2 @ slider: 0..5 step 0.1
freq = 3 @ slider: 1..8 step 1
}
"Anything after the closing brace is back at the top level."
y = amp * sin(freq * x) @ color: ORANGE, lineWidth: 3
// inFrontOfEverything draws a folder's contents over everything else - a frame
// round the graph, say, that nothing drawn later covers.
folder "Frame" { @ inFrontOfEverything
y = 4 @ color: BLACK, lineWidth: 6
y = -4 @ color: BLACK, lineWidth: 6
}
// A folder needs no title: `folder { … }` groups without naming the group. Like
// any block it may be written on one line, with a ; between its entries.
folder { y = amp * cos(freq * x) @ color: BLUE; y = amp @ color: BLACK, lineStyle: DOTTED }
Open in playground →