d3: Typed Scale interface to remove duplicate code