Filled area plots with na in between points not working as expected

Hi,

I am trying to do a filled area plot for which the traces has np.nan data. However, when np.nan data exist in the Y-axis of the trace the filling does not work as expected, i.e., It does not do the filling to the next Y trace anymore even though I am using the option fill=โ€˜tonextyโ€™.

Example without NAs work great:

trace1=go.Scatter(
x=[โ€˜W01โ€™,โ€˜W02โ€™,โ€˜W03โ€™,โ€˜W04โ€™,โ€˜W05โ€™,โ€˜W06โ€™],
y=[1.5,1.6,1.8,1.2,2,2.4],
name=โ€˜highโ€™,
fill=None,
mode=โ€˜linesโ€™
)
trace2=go.Scatter(
x=[โ€˜W01โ€™,โ€˜W02โ€™,โ€˜W03โ€™,โ€˜W04โ€™,โ€˜W05โ€™,โ€˜W06โ€™],
y=[1.4,1.3,1.2,0.9,2,2.1],
name=โ€˜lowโ€™,
fill=โ€˜tonextyโ€™,
mode=โ€˜linesโ€™
)

data=[trace1, trace2]

fig = go.Figure(data=data)
import plotly
plotly.offline.plot(figure_or_data=fig, filename=โ€™/mnt/efs/downloads/tmp/test.htmlโ€™)

Example with NAs with the filling tonexty not working:

trace1=go.Scatter(
x=['W01','W02','W03','W04','W05','W06'],
y=[1.5,1.6,1.8,np.nan,2,2.4],
name='high',
fill=None,
mode='lines'

)
trace2=go.Scatter(
x=[โ€˜W01โ€™,โ€˜W02โ€™,โ€˜W03โ€™,โ€˜W04โ€™,โ€˜W05โ€™,โ€˜W06โ€™],
y=[1.4,1.3,1.2,np.nan,2,2.1],
name=โ€˜lowโ€™,
fill=โ€˜tonextyโ€™,
mode=โ€˜linesโ€™
)

data=[trace1, trace2]

fig = go.Figure(data=data)
import plotly
plotly.offline.plot(figure_or_data=fig, filename=โ€™/mnt/efs/downloads/tmp/test_na.htmlโ€™)

Hi @dnaiel,

This looks like a bug to me. I opened an issue with the plotly.js project at https://github.com/plotly/plotly.js/issues/3296. Please follow along over there.

Thanks!
-Jon