Joe Cunningham wasn't supposed to win. South Carolina's 1st Congressional District has long been considered a reliable seat for Republicans in ruby-red South Carolina.

So it came as a surprise when the Democratic candidate scored an upset victory over Republican Katie Arrington to replace outgoing U.S. Rep. Mark Sanford.

+2 How your neighborhood voted when the 1st District turned blue A Post and Courier analysis of election results shows that suburban voters in the Charleston area, in precincts Donald Trump won in 2016, proved decisive in sending Democrat Joe Cunningham to Congress.

By looking at voting patterns at the individual precinct level, some of the factors that contributed to Cunningham's success become more clear.

A few clear patterns emerge:

Cunningham was able to win several suburban precincts that voted for Donald Trump in 2016. This is easy to see in West Ashley and Mount Pleasant. All precincts that voted for Hillary Clinton in 2016 voted for Cunningham in 2018.

Meanwhile, the vast majority of precincts tended to vote more Democratic in 2018 than they did in 2016.

Below, explore The Post and Courier's exclusive analysis of precinct-level election results.

A few precinct boundaries changed slightly between 2016 and 2018. Percent swing was not calculated for any precinct that did not have adequate data from the 2016 election. Some precincts also extend beyond the boundary of the 1st congressional district. These precincts have been trimmed to only display the area where people were eligible to vote in the SC-1 election in 2018.

How your neighborhood voted

Click on each precinct for more information. Use the search field to zoom to an address.

The Post and Courier is committed to transparency and open-source journalism. We have made the South Carolina voter precinct shapefiles used in this project available freely on Github.