Skip to content

Commit 70ca6d7

Browse files
committed
fixes from feedback from mbostock
1 parent 6a7ed11 commit 70ca6d7

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

api/index.markdown

100644100755
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,16 @@ interpolateObject.
6262
select, selectAll, filter, data, empty, node, classed, style,
6363
property, text, html, append, insert, remove, sort, on, transition, call.
6464

65-
**each**(function): Call _function_ for every item in the bound dataset. The function is invoked with two arguments: the bound data and the index of the bound data.
65+
#####each(function)#####
66+
Call _function_ for every element in the selection. The function is invoked with two arguments: the bound data for the element and the index of the bound data.
6667

67-
**attr**(name, value): Set the attribute named _name_ to _value_ on the selected elements. _name_ is XML namespace aware. _value_ can be one of three things:
68+
#####attr(name, value)#####
69+
Get or set the value of the attribute _name_. _name_ is XML namespace aware. _value_ can be one of four things:
6870

69-
- empty: remove the attribute
70-
- constant: set the attribute to the supplied value
71-
- function: set the attribute to the result of invoking the function for each item in the selection. The function is invoked with two arguments: the bound data and the index of the bound data.
71+
- empty: get the value of the attribute for the first element in the selection
72+
- null: remove the attribute
73+
- constant: set the attribute to the supplied value for each element.
74+
- function: set the attribute to the result of evaluating the function for each element in the selection. The function is invoked with two arguments: the bound data for the element and the index of the bound data.
7275

7376
#### d3.transition
7477

0 commit comments

Comments
 (0)