Inventorying diagrams in ancient mathematical and scientific texts