We could certainly build support for this into
scattergl, but I don’t know of a clean way to do it with the SVG version - see for example https://stackoverflow.com/questions/14633363/can-i-apply-a-gradient-along-an-svg-path
Note that the effect of an array
line.color would be a little different from what @tony shows in that image - it would give a gradient between blue at one point and red at the next, or perhaps there would be a mode with a segment that’s exactly half blue and half red. But what’s shown is a line that changes color at whatever point it crosses zero, even if that’s 90% of the way from one point to the next (eg point 3) or precisely at the beginning of the segment (eg 26->27).
It may be possible to create something like
line.colordirection or something to say “apply this scale in the y direction”) which on the SVG side we’d apply with a gradient stroke, behavior which of course webgl could copy. That would give exactly the effect desired here, and has a clear implementation in both svg and webgl, though array
line.color could of course do lots of things that