The problem is that you're attaching the mouse over handlers to the g
element, which isn't updated when you click on a segment. The easy way to fix this is to attach the handlers to the path
elements, which do get updated, instead. In that case you probably also want to set the text
elements to receive no pointer events so that there are no spurious mouse events when moving over them.
Complete demo here.