Assuming d3 as global; refactored out jQuery dep