.attr vs .classed in D3.js

Viewed 14342

In d3, when is it appropriate to use

d3.select("foo").attr('class', 'bar');

as opposed to

d3.select("foo").classed('bar', true);

?

Is one recommended or expected to be deprecated? What is industry standard?

2 Answers
Related