NickQiZhu/dc.js — pull request #257 by andrew-swan (2013-08-28 18:39:33+00:00)
Title: remove old pie chart labels upon update

When labels are enabled on a pie chart and there is a transition, old labels never get removed. fix that here.

I'm not sure if I approached this the right way -- it was most expedient to just add the remove() call inside createLabels() which doesn't match the apparent design of the createElements/updateElements/removeElements pattern that is in place, but I can't really figure out how exactly that is supposed to work. There is a single slices selection that gets passed in to the the *Elements() functions, but the labels data is actually re-bound separately in createLabels() and updateLabels(). Following this pattern would have meant creating a removeLabels() function and binding a third time but that didn't seem right. If I'm just badly misunderstanding the design, I'd be happy to revise...