Every president loses votes. Sometimes it’s because their party doesn’t have a majority, which, what are you gonna do. Sometimes it’s because one or two members of their party buck the tide, as was the fate of the Republican attempt to gut Obamacare in 2017. And sometimes it’s because the caucus fractures and gives the president a black eye.

On Thursday, President Trump suffered the latter.

By a 59-to-41 vote, the Senate upheld a House resolution blocking President Trump’s emergency declaration, which he hopes will allow him to build a wall on the border with Mexico. The next steps are clear: Trump already issued a formal announcement (via Twitter) that he would veto the resolution, and there are almost certainly not enough votes in the House or the Senate to override that veto. But that doesn’t mean that the loss wasn’t an ugly one for Trump.

The best way to demonstrate that is visually (though, to be fair, I often think that’s the case). Below, a complicated graphic that I’ll briefly explain.

Each of the 100 senators is plotted on two axes: ideology from more conservative to more liberal as you move from top to bottom; and the 2016 vote in the state, from more supportive of Hillary Clinton to more supportive of Trump as you move left to right. In other words, at lower left are liberal senators from heavily blue states and at upper right, conservative Republicans from Trump states.

Every Democrat supported the resolution, so let’s ignore them. Focus instead on the two types of Republicans, the 41 who voted against the resolution — and with Trump — and the 12 who didn’t (in light red). That’s more than a fifth of the caucus that voted against an issue on which the president has energetically been twisting arms.

Notice that they aren’t all clustered around the vertical line, meaning that they aren’t from swing presidential states. Nor are they all huddled around the middle horizontal line, which would mean that they are moderates. Instead they’re from all over the place, some more moderate (such as Sens. Susan Collins of Maine and Lisa Murkowski of Alaska) and some conservative (Sens. Mike Lee of Utah and Rand Paul of Kentucky). Some are from states that Trump barely won — Sen. Patrick J. Toomey (Pa.) — and some from states he won easily, such as Sen. Lamar Alexander (Tenn.).

In other words, the opposition to Trump on this issue came from across the Republican caucus. It can’t simply be attributed to one particular group.

There is one way in which those who voted against Trump are broadly similar: They aren’t up for reelection in 2020. Twenty-two Republicans are on the ballot in November next year, probably alongside Trump. Twenty of them voted to support the president, including two, Sens. Thom Tillis (N.C.) and Ben Sasse (Neb.), who seemed poised to vote against him. Tillis, in fact, wrote an essay for The Washington Post in which he explained why he would vote against Trump on the emergency declaration — but he instead voted against the resolution. (Tillis and Sasse later tried to explain their votes in statements.)

Only two Republicans on the ballot next year voted against Trump on the resolution. One is Collins, who is from a state that Trump lost in 2016. The other is Alexander, who’s retiring.

From that standpoint, Trump got some good news. It’s likely the case that Republicans worried about their reelections (or perhaps, strong primary opponents) are worried about bucking him. Well over half his caucus, though, doesn’t have to worry about reelection just yet.

This vote was one of the few times since Trump’s inauguration that his party has expressed displeasure with a core aspect of his administration. Many of those who voted to support the resolution and rebuke Trump did so to send a message about his use of an emergency declaration, worried about the slippery slope that could result from such an expansion of presidential powers. It’s the sort of divergence that could serve as a road map for future votes weighing in on Trump’s use of his authorities

If so, Trump doesn’t exactly need to start sweating. But he also shouldn’t view this vote as unimportant.