range may have only one element

If `scale.range()` returns an array with only one element, this would fail and set `w = NaN`. If there is only one element returned, we might just use that. If there's two it will use the larger one and if there's more, it will do its calculation.