[BUG] Extra random lines in go.Scatter

Hi,
I have found that extra lines are created in go.Scatter plots represented as Dash Graph objects, see the below picture:

I create the plot this way:
First, I create a plotly.graph_objects.Figure().

Next, I iterate a pandas DataFrame row by row, and for each row, I add a trace which is a go.Scatter, with mode=‘lines+markers’ set.

After representing all dots, I have to link them to create the lines, as up until this point they are independent traces.

To do so, I iterate my pandas DataFrame again, but instead of doing so row by row, I go through every group of rows with the same categorical value for the represented column in the hover seen in the screenshot. For each, I create a go.Scatter with mode=‘lines’ set.

This way, I can create a plot with lines+markers style, having independent traces for each circle, which is a requirement I need for later functionality.

The problem is that, as you can see, a yellow almost straight line is being represented at the top of the plot, which does not really exist, because when hovering, the only data point with yellow color is the one at the bottom, as it can be seen in the hover rectangle of the image. Therefore, I am not the one who is painting this line, but rather the library itself because of an unknown reason to me.

Moreover, I have realized that this sometimes happens randomly, and other times, these ‘ghost’ lines appear in the same place where another line was in the previous dash Graph object represented, which seems to me something like ’ wrong caching’ as mentioned here.

It seems to be fixed in streamleet, but not in Dash.
I am using the currently latest available versions for all packages:
plotly 5.13.0
dash 2.8.1
dash-bootstrap-components 1.3.1
dash-core-components 2.0.0
dash-extensions 0.1.11
dash-html-components 2.0.0
dash-mantine-components 0.11.1
dash-table 5.0.0

Browser: Google Chrome Version 110.0.5481.96

Best regards,
Asier.

HI @AsierSerrano welcome to the forums.

Could you please provide code + data which let us reproduce this behaviour?