NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #1921 most downloaded on npm
Pan and zoom SVG, HTML or Canvas using mouse or touch input.
Last release 5 years ago
no release in 18 months
Release timing varies
gaps range from 2 weeks to 12 months
Most releases are documented
notes for 28 of 35 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
36 releases · first in 2016
Declare wheel listener as non-passive. #225
This package now requires Node.js 12 or higher. For more, please read Sindre Sorhus’s FAQ.
Change zoom .on to pass the event directly to listeners.
One column per quarter.
See https://observablehq.com/@d3/zoom-with-tooltip for an example.
This release adopts ES2015 language features such as for-of and drops support for older browsers, including IE. If you need to support pre-ES2015 environments, you should stick with d3-brush 1.x or use a transpiler.
Nothing published for this version
Fix handling of filtered multitouch gestures. #176
Fix handling of filtered multitouch gestures. #176
Fix consuming of wheel events when the scale extent is reached. #158
Add optional point to zoom .transform and related methods. #184
Fix default zoom .extent to consider the SVG viewBox. #177
Housekeeping.
Update dependencies.
Fix touch-based zooming.
* Add *zoom*.constrain.
* Add *zoom*.touchable.
* Add *zoom*.translateTo.
Nothing published for this version
Only register touch event listeners on platforms that support touch.
Add *zoom*.wheelDelta for overriding scaling in response to wheel events. Thanks, @ondras!
Add *zoom*.clickDistance for setting the click distance threshold. Thanks, @Epiphero!
Fix primary touch location on secondary touchend.
Nothing published for this version
Nothing published for this version
Fix handling of gestures that start with multiple touches (#72).
Fix handling of a translate extent smaller than the view extent (#50).
Nothing published for this version
Add module entry point to package.json.
module entry point to package.json.Fix crash when zoom is simultaneously applied to an element and its ancestor (#41).
Fix default _zoom_.extent on Firefox (#28, #36).
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 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.
Nothing published for this version
Export to the global d3 in vanilla environments (d3/d3#2840).
d3 in vanilla environments (d3/d3#2840).Fix zero extent on SVG elements in Firefox (#28).
Only ignore no-op wheel events if not already wheeling (#26).
Fix zooming if the mouse moves during a wheel gesture.
Nothing published for this version
First (somewhat functional) release.
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →