el_pup_le
el_pup_le

Reputation: 12189

Programmatically adjusting d3 brush with animation

How can a D3 brush be programmatically adjusted from extent to extent? Can it be done so it appears to be animated rather than just instantly snapping to a final extent?

For example:

[0,0] to [0,100]

Extent just expanding to the right.

Upvotes: 2

Views: 1572

Answers (1)

Adam Pearce
Adam Pearce

Reputation: 9293

  d3.select('body').transition()
      .call(brush.extent([0, 100]))
      .call(brush.event);

http://bl.ocks.org/mbostock/6216724

Upvotes: 4

Related Questions