Update d3 definition

Add definitions and tests