Show all y-axis categories on a timeseries

I have a timeseries with categories on the y-axis.

I use the following layout:

yaxis: {
  gridcolor: '#D3D3D3',
  type: 'category',
  categoryarray: qualities,
  categoryorder: 'array',
}

My problem is that if there are some categories with no data points, by default the y-axis range does not include these.

Is there a way to show the full range of categories even if no data points are present? I have tried playing with the yaxis.range but with no luck.

Example attached. The graph on the left is what I see when I zoom out enough to show all categories (I would like this to happen by default), the graph on the right is similar to what I see by default.

You had the right idea. Here’s how to make it work:

note that plotly.js maps categories to integers for use in “continuous” attributes like yaxis.range

Ah I could have sworn that I tried that, but I must’ve made some mistake. It works as you suggest.

Thank you for your time!