javascript - radius in D3 is being drawn bigger than it should -


i'm building bubble map using d3, radius of bubbles bigger should doing operation outside of d3. i'm sure simple i'm missing first bubble map in d3, can't find is.

this code add radius attribute when drawing each bubble:

.attr("r", function(d) {       return radius(math.sqrt((math.pow(10, (1.5*d.properties.mag)+4.35)/10000000000000)/math.pi));    }); 

for d.properties.mag of 8.3, resultant bubble rendered is:

<circle id="t1442444072620" transform="translate(244.5523934369255,434.147524023737)"         r="68.38953170695866" class="selected">  </circle> 

as see, radius 68.4px. same operation changing d.properties.mag 8.3

console.log(math.sqrt((math.pow(10, (1.5*8.3)+4.35)/10000000000000)/math.pi)) 

gives me result of radius of 44 px. problem not getting right number on d.properties.mag, checked that.

thanks in advance!


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -