duration() sets how long a D3 transition runs, using milliseconds. If omitted, D3 applies a 250 ms default duration. section 7.2.4
Chain duration() after transition() and before the attributes or styles that should animate. Only properties chained after transition() are affected. section 7.2.4
Slow a histogram update
d3.selectAll("#histogram rect") .data(updatedBins) .transition() .duration(500) .ease(d3.easeCubicOut) .attr("y", d => yScale(d.length)) .attr("height", d => innerHeight - yScale(d.length)); Here, the bar position and height animate over 500 milliseconds. section 7.2.4
Reuse one duration across selections
Create a transition once, set duration(800), and pass it to both enter and exit transitions. This keeps timing consistent and avoids repeating configuration. section 7.4.3
