Right now, the stars seem aligned for Democratic gains in 2018. President Trump’s approval rating is low, Democrats lead in the House generic ballot and special elections show Republicans losing ground with some voters. It’s still a long way to the midterms and Trump’s approval might change drastically, but almost all of the early tea leaves seem positive for the out-party.

Except for the Senate map.

Every political junkie knows the Senate map is bad for Democrats. Over half of the Democratic caucus will be up for re-election, and some of these incumbents represent highly red states such as Montana, North Dakota, West Virginia, Indiana and Missouri. No party would want to go into a midterm defending a map like that.

But exactly how bad is it? Is it better or worse for the Democrats than recent maps (which have produced stalemates, historic losses, massive waves and everything in between)? And does this map completely obliterate Democratic chances to retake the upper chamber?

To get a better handle on these questions, I updated a state-level partisan strength index that I created a couple years ago. It shows that the 2018 Senate map is bad for Democrats but not unprecedented. It also suggests that Democrats aren’t favored to win back the upper chamber -- but they have to perform reasonably well in maps like this if they want to win control in later cycles.

This Is a Really Bad Democratic Map -- But It’s Not Unprecedented

There’s more than one way to think about the 2018 map, but this is my preferred way:

This graphic shows the partisan lean of each state with a Senate contest (special elections omitted) from 1986 to 2018. Each point is a Senate election (color indicates which party holds the seat), and the vertical location shows the partisan index of the state. The partisan index is simple: It’s the sum of two numbers -- a measure of the presidential and state-level partisan leanings of each state.

The presidential component takes the statewide results from the last two presidential elections, subtracts them from the national popular vote, averages them and gives the most recent presidential election 75 percent of the total weight. The intuition here is that subtracting out the national popular vote will control for wave elections (e.g. President Obama barely won Indiana in 2008 but he won nationally by seven points, so the state should still be counted as deeply red) and that the most recent election is important but not the only relevant data. Note that this formula is borrowed from FiveThirtyEight’s Harry Enten.

The state-level component comes from state legislative results. I subtracted the Republican seat share in the last state legislative elections from the average result across all states. This controls for waves and gives us a sense of which state-level party is stronger.

The average of these two numbers, our partisan index, then gives us information about both the national-level and state-level strength of both parties. Since both national and state conditions matter in Senate elections, this gives us a nice baseline for each state’s partisanship.

Basically the graphic shows that Democrats are in a bad but not unprecedented situation. They are defending a number of seats in highly red states. They’re also running in a number of swing states, including Ohio, Wisconsin, Florida, Virginia and Pennsylvania.

When a party has a map like this one, they often lose seats. In 2014, Democrats were defending a number of seats in such strongly Republican states as Louisiana, Alaska, Montana, West Virginia and Arkansas while dealing with challenges in swing states Virginia and North Carolina. Republicans swept all of those seats except for Virginia. In 2004, Democrats had to defend red states Louisiana, South Carolina, Georgia, Indiana, Arkansas and both Dakotas. Republicans ended up taking four of those seven and netting a total of four seats that year. The 1994 and 2010 Senate maps were also challenging for Democrats, and they ended up losing seats.

The pattern is no different for Republicans. In 2008, they had a tough map and ended up losing eight seats, with defeats in blue states Minnesota, Oregon and New Mexico as well as swing states Virginia, Colorado and New Hampshire.

But not every bad map ends in disaster. In 2012 Democrats were competing in the exact same states that they will be next year, but they managed to gain two seats. That’s partially because of a favorable national environment -- President Obama won his second term that year. But bad Republican candidate recruitment also helped Democrats. In Missouri, Todd Akin lost to Democratic Sen. Claire McCaskill partially because of his remarks on “legitimate rape.” Indiana Republican Richard Mourdock also faced some backlash for his comments on abortion. Additionally, strong candidates in Montana, West Virginia and North Dakota were able to beat Republicans in friendly territory. That added up to a good year for Democratic Senate candidates.

Democratic Outcomes Range From Decent to Disastrous

These examples show that the map alone doesn’t dictate the results of any Senate election. In 2014 and 2016, Sean Trende used a simple model to show that Senate races can be predicted accurately using presidential approval, the partisanship of the state, incumbency and candidate quality. While we haven’t unveiled the model’s 2018 predictions yet, a low presidential approval rating and subpar GOP candidate recruitment could mitigate Democratic losses and keep the upper chamber in play come 2020.

On the other hand, if Trump manages to improve his approval rating (maybe get it at or around 50 percent), then the weaknesses in the Democratic map would show up. Suddenly Democratic incumbents in North Dakota, Ohio, Montana, Indiana and Missouri might start to drop in the polls and Republicans would have a much greater chance of making big gains.

But it’s important to note that midterms in which the president’s party makes major gains are the exception rather than the rule. Typically, incumbent presidents tend to overreach or run into hard times in the first part of a term and then get punished for it in the midterms. President Obama managed to pass the Affordable Care Act in 2010, but he paid the price for it in that fall. President Bush’s party lost enormously in 2006 as the Iraq War spun out of control and his administration failed to respond adequately to Hurricane Katrina. Bill Clinton, Ronald Reagan, Gerald Ford, Jimmy Carter, Lyndon Johnson, Dwight Eisenhower, Harry Truman and even FDR all endured at least one midterm where their party lost a significant amount of power at some level of government. So Trump would have to seriously improve his approval rating to fully realize the potential for Republican gains in this map.

If Democrats Want to Win Back the Senate, They Need to Do Okay in Maps Like This

Mapping the data in this way allows us to take a step back and see that Democrats need to compete in unfriendly territory. Heading into 2016, the Senate map was well-sorted -- Democrats mainly defended blue states and Republicans mainly defended red states. And only two seats, New Hampshire and Illinois, changed hands. In 2014, Republicans took back the upper chamber by winning red states North Dakota, West Virginia, Arkansas, Montana and Louisiana as well as some swing states. All this means that the 2020 map will be more sorted.

If Republicans manage to make the 2018/2024 Senate maps as well sorted as the other two, Democrats could have some serious issues retaking the upper chamber in the near term. In our current political alignment, Republicans tend to win many of the less populous states (though not all of them), and Democrats often triumph in the most populous ones. That gives Republicans an advantage in the Senate (where each state has two members), and makes it imperative that Democrats win when confronted by maps like 2018’s. If they can’t hold some seats in swing or red states, they will have trouble farther down the road.