Why scale doesn't work as expected?

EDIT: i changed my code with code from this project:
pen [ http://codepen.io/mtroiani/pen/YWKJEy?editors=0010 ]
but still wondering how to work with this mine code:

45 line change with this:

  var scaleByRadius = d3.scale.linear()
                          .domain([radiusArr[0], radiusArr[radiusArr.length-1] ])
                            .range([5, 30]);

pen: [ https://codepen.io/ustvarno/pen/VjdWZw?editors=0010 ]
i get weird scale numbers, all is in console
line 32 - logged values for scaling function domain
line 34 - my scale function
line 58 - logging number for scaling, and number that scale function return