Skip to content

Releases: d3/d3-zoom

v1.1.0

23 Nov 01:25
Compare
Choose a tag to compare
  • Add zoom.interpolate (#54).
  • Fix handling of a translate extent smaller than the view extent (#50).
  • Allow the double-click and -tap zoom transitions to be disabled (#49).

v1.0.3

02 Aug 21:21
Compare
Choose a tag to compare
  • Add module entry point to package.json.

v1.0.2

07 Jul 12:38
Compare
Choose a tag to compare
  • Fix crash when zoom is simultaneously applied to an element and its ancestor (#41).

v1.0.1

25 Jun 15:09
Compare
Choose a tag to compare

v1.0.0

24 Jun 18:11
Compare
Choose a tag to compare
  • First stable release.

Changes since D3 3.x

The zoom behavior d3.behavior.zoom has been renamed to d3.zoom. Zoom behaviors no longer store the active zoom transform (i.e., the visible region; the scale and translate) internally. The zoom transform is now stored on any elements to which the zoom behavior has been applied. The zoom transform is available as event.transform within a zoom event or by calling d3.zoomTransform on a given element. To zoom programmatically, use zoom.transform with a given selection or transition; see the zoom transitions example. The zoom.event method has been removed.

To make programmatic zooming easier, there are several new convenience methods on top of zoom.transform: zoom.translateBy, zoom.scaleBy and zoom.scaleTo. There is also a new API for describing zoom transforms. Zoom behaviors are no longer dependent on scales, but you can use transform.rescaleX or transform.rescaleY, transform.invertX to transform a scale’s domain. 3.x’s event.scale is replaced with event.transform.k, and event.translate is replaced with event.transform.x and event.transform.y. The zoom.center method has been removed in favor of programmatic zooming.

The zoom behavior finally supports simple constraints on panning! The new zoom.translateExtent lets you define the viewable extent of the world: the currently-visible extent (the extent of the viewport, as defined by zoom.extent) is always contained within the translate extent. The zoom.size method has been replaced by zoom.extent, and the default behavior is now smarter: it defaults to the extent of the zoom behavior’s owner element, rather than being hardcoded to 960×500. (This also improves the default path chosen during smooth zoom transitions!)

The zoom behavior’s interaction has also improved. It now correctly handles concurrent wheeling and dragging, as well as concurrent touching and mousing. The zoom behavior now ignores wheel events at the limits of its scale extent, allowing you to scroll past a zoomable area. The zoomstart and zoomend events have been renamed start and end. By default, zoom behaviors now ignore right-clicks intended for the context menu; use zoom.filter to control which events are ignored. The zoom behavior also ignores emulated mouse events on iOS. The zoom behavior now consumes handled events, making it easier to combine with other interactive behaviors such as dragging.

See CHANGES for all D3 changes since 3.x.

v0.3.1

19 Jun 16:37
Compare
Choose a tag to compare
  • Update dependencies.

v0.3.0

08 Jun 04:01
Compare
Choose a tag to compare
  • Export to the global d3 in vanilla environments (d3/d3#2840).

v0.2.2

26 May 16:03
Compare
Choose a tag to compare
  • Fix zero extent on SVG elements in Firefox (#28).

v0.2.1

26 May 04:53
Compare
Choose a tag to compare
  • Only ignore no-op wheel events if not already wheeling (#26).

v0.2.0

26 May 04:51
Compare
Choose a tag to compare