The static gauges are a bit notorious for being slow, to the point that many use a script transform on an embedded svg instead.
I would recommend making the script part of the transform a function in the project library for easy re-use(and to avoid having to import inside of a function).