I believe that whoever did the sparkler trails was wearing all-black clothing AND black gloves. Seriously. One of the keys in this kind of shot is the ISO used, in conjunction with the specific lens aperture. The brightness of the sparkler creates its own image; if the ISO value is too low, like say ISO 50, then the sparkler's light creates a weak, dim, and under-exposed image. If the ISO value is too high, like say 3,200 or even 1,600, then the sparkler's light will crete a pale, washed-out, over-exposed image.
Same goes for the lens aperture used; see how in the background there appears to be some color (light) in the night sky??? That's a clue that this shot was done just minutes after twilight had come, but not yet in full, total black of night; let's say 5-10 minutes before FULL darkness.
As when photographing fireworks rockets, there needs to be a balance between the brightness of the firework [sparkler in this case], and the f/stop and ISO used. TOO high of an ISO setting and too wide of an aperture means a washed-out, dull, lifeless pale light yellowish color that looks bad. Let's just say, start at ISO 250 at 30 seconds at f/8 as a generalized beginning point. Use DAYLIGHT white balance and NOT automatic white balance. A tripod is needed, obviously. Have the sparkler holder dressed in dark clothes, and always moving.
If you are ending up with just "a regular line" and not a nice, rich shower of sparks, that means that the ISO level is too low, and/or the lens aperture is too small (like say f/16). To make the sparkler's sparks stronger, the ISO value needs to go UPWARD. The time the shutter is open allows for movement of the sparkler across the picture area, and it NEEDS to be at LEAST 10 seconds. The thing is the time the shutter is open is NOT controlling the rendering of the sparkler!!!! The shutter time in this kind of shot is controlling ONLY how much movement can be captured.