|
|
|
@ -74,7 +74,7 @@ d3.selectAll('circle')//make a "ghost call" to all circles, even if there are no
|
|
|
|
once data has been bound to elements, you can call something like:
|
|
|
|
once data has been bound to elements, you can call something like:
|
|
|
|
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
```javascript
|
|
|
|
selection.attr('r', function(d,i){ //d is data for the current element, i is the index of that element in the array
|
|
|
|
d3.selectAll('circle').attr('r', function(d,i){ //d is data for the current element, i is the index of that element in the array
|
|
|
|
//callback will be executed for each DOM element
|
|
|
|
//callback will be executed for each DOM element
|
|
|
|
//return value is how each value will be set
|
|
|
|
//return value is how each value will be set
|
|
|
|
return d.value * 2 //takes value property of d (data), multiplies it by two and sets the radius to that
|
|
|
|
return d.value * 2 //takes value property of d (data), multiplies it by two and sets the radius to that
|
|
|
|
|