Republican presidential nominee Donald Trump attends a church service in Detroit on Sept. 3, 2016. (Carlo Allegri/Reuters)

There are countless reasons Donald Trump is president of the United States and Hillary Clinton is not. Decisions made by the campaigns, where advertising ran, who was knocking on which doors, what news broke and was covered when. The reason most commonly cited for Trump’s victory — a victory that relied on winning Wisconsin, Michigan and Pennsylvania by a combined margin of fewer than 78,000 votes — is that Trump managed to appeal to working-class white voters in the Midwest just enough to carry the day.

But there’s another factor that bears mentioning. One of the reasons Trump is president and Clinton isn’t is because of how black Americans voted relative to 2012.

After the 2016 election, Ryne Rohla gathered precinct-level vote tallies from nearly every neighborhood in the United States for Decision Desk HQ. This data, which he also collected for the 2012 race, offers a uniquely specific overview of how Americans voted that we’ve used to analyze where Americans were most likely to live in bubbles of shared political thought and how the candidates fared in the places where they raised the most money.

It also allows us to compare specific neighborhood-level demographic data with voting results. This is somewhat imprecise, requiring that we overlay census tracts with precinct boundaries, two geographic areas that rarely line up neatly. But by tallying the results in each precinct that overlaps a census tract — an area that’s generally about neighborhood-sized — we can get a sense of how those areas voted.

Because the Census Bureau offers detailed tallies of the racial composition of those areas, we can use this data to see how mostly white, mostly black and mostly Hispanic neighborhoods voted in both 2012 and 2016. Which we did. On the graphs below, moving from left to right is an increase in the density of the white, black or Hispanic population in a census tract. The vertical axis is how much support each party’s candidate received in 2012 (lighter color) and 2016 (darker).

A few things jump out. First: The most heavily white neighborhoods voted much more heavily Republican in 2016 than in 2012 (the dark red line shoots up past the light-red one). Second, the most heavily black neighborhoods voted less heavily Democratic last year than four years ago. (We’ll come back to this, obviously.) Third, Hispanic neighborhoods voted for Republicans less than in 2012.

The net effect of those shifts can be measured by comparing the margin between Barack Obama and Mitt Romney in 2012 with the Trump-Clinton margin in each neighborhood last year. In heavily white neighborhoods, a big shift to the Republicans. In mostly Hispanic neighborhoods, generally more support for the Democrat, except in the most dense places (although, as the chart on the right makes clear, the sample size for those is very small and therefore more subject to volatility).

That red line for white neighborhoods is very important and bolsters the focus on white voters after the 2016 election. But that blue line, showing more heavily black neighborhoods voting more Republican than in 2012, has been under-recognized.

There are two reasons this might have happened. The first is a change in support among black voters that favors the Republican. The second is a decrease in black turnout, meaning that the white voters in those neighborhoods who were more likely to back Trump carried more weight in the results.

Both appear to be the case to some extent.

Obama’s presence on the ballot helped galvanize a lot of support from black Americans for the Democratic presidential candidate. In 2008 and 2012, exit polling shows that black voters supported the Democratic presidential candidate at record levels, with Obama winning 95 percent and 93 percent of the black vote respectively. In 2016, Clinton won 88 percent of the black vote, the same percentage as John F. Kerry won in 2004.

Trump earned less support from black Americans than any Republican in 40 years, except those who ran against Obama. But a small uptick in support for Trump vs. Romney combined with less support for Clinton means that Obama’s 87-point margin became an 80-point margin for Clinton. That mattered.

Notice, too, that exit polling suggests a decrease in how much of the electorate was black in 2016. The Census Bureau collects data on that, too, which the University of Florida’s Michael McDonald used to estimate turnout percentages and composition of the electorate for the past 30 years.

In 2016, the turnout rate for black Americans dropped about eight percentage points, McDonald estimates — meaning that that many fewer black Americans who were registered to vote did so. That’s a lower rate than in 2004. The percentage of white voters turning out increased slightly.

Overall, as the exit polls suggest, black voters made up a lower percentage of the electorate.

It’s important to remember that Trump praised this drop in black turnout during one of his victory rallies in December. It’s also important to note that Bloomberg News reported in October that Trump’s campaign was trying to suppress black turnout using nonpublic posts on Facebook to raise questions about Clinton’s commitment to the black community. We looked at that effort in December, noting that turnout was lower in more heavily black counties in those critical states of Michigan, Pennsylvania and Wisconsin than the states overall.

The Rohla precinct data allows us to look more closely at the shifts. Below, every census tract, with the size of circles reflecting the density of the black population. Bigger circles, a higher percentage of black voters in the tract. The color of the circle reflects the shift in the vote since 2012. More blue, a bigger shift to the Democrats. More red, a shift to the Republicans. (Click the map to view a larger version.)

California has a lot of blue, as does Utah. In the broad swath of the Atlantic and Gulf coasts, though, a lot of pink and red.

Below we’ve isolated only those tracts that are at least half black. Notice how many more are tinged red than blue.

Zooming in on the Midwestern states that made the difference last year:

And again restricting the display to majority-black neighborhoods:

Not many in Wisconsin. A lot in Michigan. Nearly all some shade of red.

Was it enough to make up the 10,704-vote margin in that state? Probably. Because of how these margins are calculated, though, overlapping precincts with census tracts, precise vote totals are harder to calculate than percentages of support.

Are shifts in black voting responsible for Clinton’s loss? They probably played a role. Victory, as they say, has a thousand fathers. In this case, defeat does, too.