Generating resource hit stats in a JS popup using D3 library