Wayne Gretzky's sage advice — to "skate to where the puck is going, not to where it has been" — works as well in politics as it does in hockey.

To make gains in any election, a party must anticipate where it has the potential to make a breakthrough, not just where its support is already strong. Analyzing how the partisan 'lean' of each riding has shifted over the last few elections provides some clues to where those places might be.

A riding's partisan lean is a measure of how far it tilts toward one party or another compared to the country as a whole.

For example, the Liberals took 42.7 per cent of the vote in the riding of Ottawa Centre in 2015, compared to the 39.5 per cent of the vote the party captured nationwide. That means Ottawa Centre had a Liberal lean of 3.2 points — it was 3.2 percentage points more Liberal than the country as a whole.

While that lean can shift over time, it tends to remain relatively constant even when a party's fortunes change dramatically at the national level. But if a riding's partisan lean increases or decreases over several consecutive elections, it suggests the riding is changing in a way that goes beyond the normal ups and downs of a party's popularity.

This could be due to a number of factors — the changing demographics of a riding, for example, or a party's ability to plant new roots.

But these trends also might tell us something about where to look for changes in the 2019 federal election that could defy wider shifts in political support. Looking at the trend in the partisan lean of a riding relative to both the national and provincial landscapes allows us to identify seats that are true outliers, rather than ones that are mostly being swept up in provincewide shifts.

Ottawa, Calgary getting more Liberal

There are a handful of ridings that have shown consistent growth in their Liberal partisan lean over the last three elections relative to both the rest of the country and the rest of their respective provinces.

But they are primarily concentrated in just two parts of the country: Ottawa and Calgary.

Five ridings in the Ottawa area — Kanata–Carleton, Nepean, Orléans, Ottawa Centre and Ottawa West–Nepean — have seen their Liberal partisan lean get bigger over three consecutive elections. The shift has been particularly marked in Kanata–Carleton and Nepean, two ridings in which the Conservative partisan lean has decreased over three consecutive elections.

Based on current electoral boundaries, the area that now makes up Kanata–Carleton was 6.6 percentage points less Liberal than the country as a whole in 2006. In 2015, the riding leaned 11.8 points more Liberal than the rest of Canada.

In Nepean, the Liberal lean went from -2.2 in 2006 to +12.9 in 2015. These shifts helped flip these two ridings from the Conservatives to the Liberals in 2015.

Both Calgary Centre and Calgary Confederation have become more Liberal than both Alberta and the rest of the country over the last three elections. In 2006, Calgary Centre and Calgary Confederation leaned 11 and 16.5 points less Liberal than Canada as a whole. In 2015, these ridings were seven and four points more Liberal, respectively.

In addition to these two ridings, Calgary Forest Lawn and Calgary Skyview have become more Liberal than other Albertan ridings (though not more Liberal than the rest of the country) over three consecutive elections.

This suggests the Liberals could look for some gains in Calgary in 2019. The city certainly has changed over the past decade, which could be causing its political profile to shift as well. According to Statistics Canada, the immigrant population of Calgary has gone from 24.8 per cent in 2006 to 31.3 per cent in 2016, while the proportion of visible minorities has jumped to 36.2 per cent from 23.7 per cent over that time.

Safe and swing ridings moving right

The ridings that have become increasingly Conservative over the last three elections are mostly in two very different locations.

On the one hand, six ridings have shown consistent growth in their Conservative partisan lean (both relative to the national and provincial climates) in rural Alberta and Saskatchewan: Battlefords–Lloydminster, Carlton Trail–Eagle Creek, Grande Prairie–Mackenzie, Moose Jaw–Lake Centre–Lanigan, Souris–Moose Mountain and Yellowhead.

But there's little for the Conservatives to gain here: these six seats were won by the party with an average of 68 per cent of the vote in 2015.

On the other hand, the five ridings in the Greater Toronto Area that have become more Conservative over the last three elections have more potential.

Conservative Party Leader Andrew Scheer will be looking for significant gains in the Greater Toronto Area in the 2019 federal election. (Graham Hughes/Canadian Press)

These are Eglinton–Lawrence, Markham–Stouffville, York Centre, Markham–Unionville and Thornhill. The Conservatives managed to hold on to the last two in 2015 — the only islands of blue in an otherwise Liberal red GTA. The fact that Thornhill resisted the Liberal wave might be chalked up to Peter Kent, a relatively high profile Conservative MP.

But Markham–Unionville was retained by Bob Saroya, a rookie Conservative candidate. He bucked the wider trends in the region that were working against the Conservatives, in part because Markham–Unionville already had been moving deeper into his party's column.

Based on the current electoral boundaries, Markham–Unionville was 9.6 percentage points less Conservative than the rest of the country in 2006. In 2015, Saroya took 17.5 percentage points more of the vote than the Conservatives did nationwide.

It suggests that this riding — as well as a few others in the GTA — have become more friendly to the Conservatives over time, even when they elected Liberals. The Conservative-leaning GTA ridings the Conservatives lost in 2015 should be high on their list of targets in 2019.

Few ridings leaning more NDP

It is harder to locate ridings that have become increasingly New Democratic over the last three elections relative to the national and provincial landscapes. In fact, there are only two: Vancouver Kingsway and Rosemont–La Petite-Patrie.

The New Democrats have held Vancouver Kingsway since 2008 and won it by a comfortable margin in 2015.

But the increasingly NDP lean of Rosemont–La Petite-Patrie suggests the party is planting some roots in certain parts of Quebec where they have strong MPs. Represented by Alexandre Boulerice, NDP Leader Jagmeet Singh's Quebec lieutenant, the riding has gone from being six points less New Democratic than the rest of the country in 2006 to being 29.5 points more NDP in 2015 — a lean that has increased consistently from election to election.

Jagmeet Singh's NDP does not have a lot of ridings that are becoming friendlier to the party over time — but a few good MPs in Quebec could help save some seats in the province. (Darryl Dyck/Canadian Press)

A handful of other leading Quebec NDP MPs — including Roméo Saganash in Abitibi–Baie-James–Nunavik–Eeyou, Ruth Ellen Brosseau in Berthier–Maskinongé and Parliamentary Leader Guy Caron in Rimoutski-Neigette–Témiscouata–Les Basques — have increased the partisan lean of their ridings over the last two elections, suggesting they have been successful in establishing an NDP base despite the party's significant drop in support in 2015.

It also suggests that these MPs (with the exception of Saganash, who is not running again) might be able to hold on to their seats even if the party's support in Quebec takes another hit in 2019.

Of course, the name on the ballot has a big influence on whether a riding leans more toward one party or another. But the fundamental character of a riding — and how that character changes over time — also weighs heavily in the balance.