Districts are set by total population. It can create a significant disparity, but that is the basis that has been approved by the courts, including—most recently—the Supreme Court in Evenwel v. Abbott. The chief exception is that prisoners can be excluded from the population base.