Examples
- Canvas: the basic shapes
pie.* draws: points, lines, triangles, circles, arcs, ellipses, curves and text. Also colors, the grid settings, and a shape defined in TypeScript.
- Reactivity: change one node and everything built from it updates. The midpoints of any four-sided shape form a parallelogram that stays one as you move the corners, with a label that keeps up.
- Broadcasting: pass arrays and a function runs once per item, matched by numpy's shape rules. Points from
linspace, a 4 × 3 grid of circles, and a parabola made only of straight lines.
- Autodiff:
pie.partial draws exact gradients as arrows. The gradient of a triangle's angle points at its circumcenter, the gradient of its area is at right angles to the opposite side, and the gradient of the distance sum explains an ellipse's mirror property.
- Animation:
animate=True makes values glide instead of jump. A line of points folds into a circle and a star, and bubble sort runs bar by bar.
- Python: numpy, scipy and matplotlib in the browser, with no canvas. Anscombe's quartet shows four datasets with the same statistics that look nothing alike, then
curve_fit fits a damped spring.