Update d3 definition

Add typing's and comments