Skip to content

Commit c25d409

Browse files
committed
Document attr()
1 parent 7a9e255 commit c25d409

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

api/index.markdown

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,17 @@ interpolateObject.
5959

6060
#### d3.select\[All\]
6161

62-
select, selectAll, filter, data, each, empty, node, attr, classed, style,
62+
select, selectAll, filter, data, each, empty, node, classed, style,
6363
property, text, html, append, insert, remove, sort, on, transition, call.
6464

65+
attr(name, value): Set the attribute named _name_ to _value_ on the selected
66+
DOM node. _name_ is XML namespace aware. _value_ can be one of three things:
67+
* empty: remove the attribute
68+
* constant: set the attribute to the supplied value
69+
* function: set the attribute to the result of calling the function. The
70+
function is invoked with two arguments: the bound data and the index of
71+
the bound data.
72+
6573
#### d3.transition
6674

6775
delay, duration, ease, attrTween, attr, styleTween, style, select, selectAll,

0 commit comments

Comments
 (0)