How can I set the alpha value of lines connecting only certain points in my plotly.js scatter chart?

Hi, you could add each line segment as a single trace and change the line color of the corresponding segment.

Pretty much like this (unfortunately Python):