We use a combinatorial result relating the discriminant of the cycle pairing
on a weighted finite graph to the eigenvalues of its Laplacian to deduce a
formula for the orders of component groups of Jacobians of modular curves
arising from quaternion algebras over Fq(T) or Q. Our
formula over Q recovers a result of Jordan and Livn\'e