Is it possible to do heat lines on MapServer similar to the following image. The datasource will be PostGIS.
If your data are points and your have the value of power as an attribute then you can. See the documentation about colorrange, datarange, and rangeitem in https://www.mapserver.org/mapfile/style.html.
The result is not as neat as in your image but it can be acceptable if you have dense points. It could look like this (image captured from a manual of another software, Reefmaster https://reefmaster.com.au/.
Colorrange takes just two colors so perhaps you can't have the similar scale as in your image. Also if the power value has been stored into vertices of a linestring as M coordinate (or fake Z) the MapServer can't help you. And if you have data as points you can do the same thing that colorrange does also by making a normal point layer that is classified by power. It would mean more work with writing the mapfile but also full control on the colors.