This seemed to have been a bug in plotly. The newer versions fix this bug. My original attempt now works as expected. Here is how the output looks with plotly-4.10.4 -
plotly-4.10.4