Fix tests after d3 upgrade

d3 somewhere around v3.4.12 seems to no longer return numbers when doing `.attr('height')` and `.attr('width')` on svg elements.