The geometry of on-shell diagrams