optimised d3 usage