Metric graphs, cross ratios, and Rayleigh’s laws