How about encapsulating all the little helper variables in a function and just doing:

    var graphHeight = computeGraphHeight()

That way, my brain can immediately parse that they are not used anywhere else afterwards and needs to keep less context :) If the function lives in parallel to `metricToTsName()`, it doesn't even need to take any arguments, since the necessary bits are already in its scope.