If a zoom transition is in progress, using zoom.event, a mousewheel gesture will interrupt the transition and cause a zoomend event, which resets the center0 variable to null. Previously, the center0 variable was assigned in the mousewheel handler prior to the interruption. This fix assigns it after the interruption.
During a combined zoom/pan gesture, controlled via simultaneous use of the mousewheel and dragging, it is possible for the drag to finish before the use of the mousewheel finishes. The mousewheel gesture is deemed to be finished if 50ms passes with no mousewheel event. Although the "zoomend" event is only dispatched when *both* gestures have finished, the variable "center0" was being reset when *either* gesture was finished, causing an error in the mousewheel handler. Fixes #2205.
Code that previously assumed a global document or window now uses the related node’s ownerDocument or ownerDocument.defaultView as appropriate. If no related node is available, the corresponding code will crash; however, the rest of D3 will work just fine. For example, you can’t use d3.select(string) unless a global document is available; it just doesn’t make sense. Use d3.select(node) instead, followed by selection.select(string). Code that previously checked for a global on the window (e.g., XDomainRequest) now uses the global context (`this`) rather than the window.
Normally selection.append is only called on normal elements that have a defined namespaceURI. However, if createElement is called on a shadow root, then namespaceURI is null. Now we correctly fallback to createElement instead of createElementNS in this case. Fixes #2161.
When a transition is interrupted, the interrupt event is dispatched immediately (such as within a call to selection.interrupt). This is easier to understand and guarantees that the interrupt event on an interrupted transition is dispatched prior to the start event on an interrupting transition, fixing #2140. Calling selection.interrupt repeatedly no longer cancels any scheduled (but inactive) transitions, fixing #2141. Calling selection.interrupt when there is no active transition now has no effect. An interrupt event is only dispatched if the active transition is interrupted, and not if a scheduled transition was cancelled, as when a delayed transition is superceded by an earlier transition on the same element. These transitions are cancelled silently, fixing #2144. Lastly, transition event listeners now see the latest bound data, rather than using the data that was captured shortly after the transition was scheduled. Fixes #2142.