selection.attrs(values)
A convenience method on top of selection.attr for setting multiple attributes. If the specified values is an object, the values may be specified either as strings or functions. For example:
selection.attrs({foo: "foo-value", bar: function(d) { return d.bar; }});
If a value is a constant, all elements are given the same attribute value; otherwise, if a value is a function, the function is evaluated for each selected element, in order, being passed the current datum (d),