Press Preview, then click and drag your way through this page.
Code in a pygeomatic block runs without the reader seeing it. Name a few lines
with with group(...) and they become a link your reader can click.
Reach the point by of units, then .
A slider is just a number. Put it in a sentence with an f-string, and use
gm.md to write that sentence.
Click to draw the circle:
Drag to resize the circle:
Anything built from r follows on its own:
whose side is . Changing also changes the side of this square.
n above and the point updates reactively.
with when(...) hides text until a condition is true. The condition is checked
as your reader moves things, so there is nothing to click.
You ticked the box, so this appeared.
Large: the radius is 4 or more.
Small: the radius is under 4.
The dropdown is on product. Conditions read text too.
Give a formula an id with a %id: line, then attach a number to a slot inside
it. The formula updates whenever that number does.
Drag the upper limit:
Watch the in the formula follow the slider. Or set it from here: ·
You can also paint parts of a matrix, and move the painted part with a number:
Row to highlight:
You can also highlight upper triangular entries of a matrix as shown below:
Conditions can do more than pick a row. M.rows() and M.cols() are the row and
column number of each cell, so you can do arithmetic on them and join the results
with & and |. Each cell is painted only where the condition holds.
The slider below sets how far from the diagonal a cell may sit. The two
conditions are cols - rows <= band and rows - cols <= band, which together
mean "no further than band steps either side of the diagonal":
Widen the band:
At 0 only the diagonal is painted; at 4 the whole matrix is.