First lady Melania Trump, President Trump, Vice President Pence, former president Barack Obama, former vice president Joe Biden and Michelle Obama walk down the steps of the U.S. Capitol on Jan. 20, 2017. (Rob Carr/Getty Images)

The Gallup organization regularly publishes reports on the partisan leanings of the states, snapshots of the ebb and flow of political self-identifications across the country. The most recent compilation provides one more piece of evidence of the degree to which Americans have moved away from the Democratic Party since former president Barack Obama was first elected.

The story of the Democrats over the past eight years is well known. Obama twice won a majority of the popular vote and left the White House with an approval rating in the high 50s. Despite that, his party suffered massive losses in Congress, among governors and in state legislatures. Hillary Clinton, his designated successor, lost to Donald Trump in November.

President Trump has generated anger and energy across the country among those who oppose him and much of his agenda. Trump’s disapproval ratings are higher than for any new president. Republicans in Congress sometimes appear flummoxed, even alarmed, by what Trump says and does. Democrats see all this as an opportunity for recovery. But they start from a very deep hole.

Gallup’s most recent findings on party identification in the states provide one indicator, perhaps imperfect, for measuring what was lost during Obama’s presidency and a benchmark for gauging whether Trump’s presidency moves the pendulum in the opposite direction.

Partisan identification as measured in polls is in constant flux. Monthly surveys record occasional spikes, depending on what is in the news. If Democrats are having a bad week, fewer people want to identify with them, and vice versa. Gallup’s report measures changes based on annual averages of party identification (not party registration).

The most telling headline in the latest report, written by Jeffery M. Jones, says, “All movement since 2008 in GOP’s direction.”

For context, the year 2008 was a banner year for the Democrats in terms of party identification, thanks to Obama’s candidacy. Gradually, things fell back to Earth. The effect is the portrait of a changed country.

[Trump taps into fears as a tool of governing]

In 2008, Gallup found 35 states either solid or leaning Democrat in party identification, compared with just five for the Republicans. The remaining 10 were listed as competitive, which meant the gap between Democratic and Republican identification was fewer than five points. In 2016, there were just 14 states that were either solid or leaning Democrat, compared with 21 for the Republicans. Gallup listed 15 as competitive.

Some of the change reflects the decades-long ideological sorting-out of the two parties. Many Southerners, for example, continued to call themselves Democrats long after they had started voting regularly for Republicans, first at the presidential level and later at the congressional level.

Two examples of this are Arkansas and West Virginia, two states Democrats have not carried presidentially since 1996. From 2008 to 2016, adults in Arkansas shifted from a net plus of 12 points for the Democrats to a net plus of 14 points for Republicans. West Virginia moved 28 points in the GOP’s direction. In 2016, Trump carried Arkansas by 27 points and West Virginia by 42 points.

More pertinent to the election results, Pennsylvania, Michigan and Wisconsin — states that Trump won narrowly and that provided him with his electoral college majority — moved during the Obama years from a solid Democratic rating in 2008 to a competitive rating in 2016.

Partisan identification as measured in surveys is not rigid or perfectly correlated with voting behavior. But the degree to which Gallup’s findings mesh with what happened in 2016 are notable. Trump won all 21 Republican states, and Clinton won all 14 Democratic states. Trump carried nine of the 15 competitive states (some of which aren’t really competitive presidentially).

The 2016 election was another example of the degree to which red-blue partisanship has hardened and now affects voting up and down the ballot. There are suggestions that, because Trump’s views cut across traditional ideological lines, his presidency could roil the coalitions of both parties. Eventually that might be the case, but for now there’s no better indicator of how someone will vote than how they align by party.

In November, about 9 in 10 Republicans voted for Trump and about 9 in 10 Democrats voted for Clinton. That’s been true for a number of election cycles. More significantly, ticket splitting was, again, a rarity, despite earlier speculation that Trump might scramble voting patterns in down-ballot races. Trump and Clinton altered recent voting patterns in some counties. But overall, the 2016 election produced a consistent outcome up and down the ballot.

[Outside of Washington, resistance to Trump builds]

As Democrats look to rebuild their strength in the House and Senate, the implications of all of these threads are problematic. Geography and party-line voting are working against them. Gerrymandering is certainly a factor, but the problem is not limited to that.

The Cook Political Report’s David Wasserman and Amy Walter have recently highlighted the continuing shrinkage in the number of House seats held by the party that lost the presidential vote in those districts. Eight years ago, there were 83 congressional districts held by the “opposite” party. At the start of this Congress, there were just 35 — 12 Trump-won districts in Democratic hands and 23 Clinton-won districts held by Republicans.

The party that holds the White House generally loses seats in midterm elections, but that is in part because presidents often sweep in House candidates from districts where they otherwise would lose. The absence of seats that are out of order means there are fewer easy targets for Democratic pickups in 2018 than has often been the case.

Gary Jacobson, a political scientist at the University of California at San Diego, offered his analysis of this pattern in the draft of a recently scholarly paper. “Victories against the partisan grain have become exceedingly rare in this decade and now account for only 2 percent of House seats,” he said. “Consistent party-line voting has magnified the advantage Republicans enjoy from the more efficient distribution of their regular voters across districts.”

Democrats are already at a big disadvantage in the 2018 Senate elections, having to defend 25 seats to just eight for Republicans. Ten of those Democrats sit in states won by Trump, with five of them in what would be considered truly red states. Incumbency is often a strong shield against shifting partisanship within a state, but it wasn’t enough, for example, to protect Mark Pryor in Arkansas in 2014. Elected twice before (and unopposed by a Republican in 2008), he lost to Sen. Tom Cotton by 17 points after Obama lost the state by 24 points in 2012.

The Gallup report notes that because Democratic states tend to be more populous, nationally more people still identify as Democrats than Republicans. That helps explain why Clinton won the popular vote and lost the electoral college and the presidency, and it points to the disadvantage for Democrats in House and Senate races.

Much obviously depends on how the public reacts to Trump’s presidency. In 2002, Gallup found that more states identified as Republican than Democratic. The later years of George W. Bush’s presidency caused many people to identify as Democrats. But at the start of Trump’s presidency, the country is aligned geographically in a way that remains advantageous to Republicans. As a result, Democrats should not underestimate the challenges they face regaining ground lost.