Whether Democrats can continue to excel among the most affluent voters is one of the biggest questions heading into the midterm elections. Democrats are hoping to compete in many well-educated, affluent districts where Mr. Trump struggled but where voters have traditionally voted Republican and continued to do so down-ballot in 2016.

In special and general elections in the last year and a half, Democrats have generally succeeded in matching Mrs. Clinton’s tallies in the areas where she most outperformed prior Democrats, like in Georgia’s Sixth Congressional District or in Northern Virginia. But they typically haven’t outperformed Mrs. Clinton by much, and in some cases not at all — and those elections didn’t have a Republican incumbent on the ballot.

The precinct-level data, which is far more granular than the county-level data available immediately after the election, complements a growing body of evidence that is forcing a re-evaluation of some of the initial views of the 2016 presidential election. It appears that Mrs. Clinton succeeded at winning over many rich and well-educated Republicans, perhaps by an even wider margin than pre-election polls implied, just as Mr. Trump made big gains in the poorest white communities compared with Mr. Romney. But there were more not-so-affluent white voters without a college degree in the battleground states, and Mr. Trump’s success with them was enough to give him the edge in the Electoral College.