Prevent d4 from trying to create an SVG element with dimensions less than zero.
use max instead of abs.