Discontinuity when plotting continuous days with and without a leap year

Hi- we have a dashboard that uses plotly.js to compare year-over-year time-based data. So, we’ll plot one trace for every day this year and another trace for every day last year, using the ‘%m/%d’ x tick format to make them appear on the same time scale.

This has worked fine until this recent leap day occurred. Now, there is a discontinuity in the 2020 data and the 2/29 point is rendered at the end of the x axis instead of its proper place. Here’s an example made with a codepen


It’s not immediately obvious to me how to get around this. Has anyone dealt with something like this before?


It does appear that reversing the order of the traces fixes the issue (I guess it uses the first trace to compute the x axis values?). It’s not a great solution, but it’ll work if anyone else comes across this.