NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #1856 most downloaded on npm
Drag and drop 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 1 weeks to 12 months
Most releases are documented
notes for 21 of 27 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
28 releases · first in 2016
Declare some event listeners as non-passive. #78
This package now requires Node.js 12 or higher. For more, please read Sindre Sorhus’s FAQ.
Change drag .on to pass the event directly to listeners.
See https://observablehq.com/@d3/circle-dragging-ii 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.
One column per quarter.
Nothing published for this version
Add sideEffects: false to the package.json.
Fix default drag .filter on control-click. #62
Housekeeping.
Update dependencies.
Optimize drag .touchable slightly.
Add drag .touchable . ( #41 ) Thanks, @nicolas-van !
Only register touch event listeners on platforms that support touch.
Add *drag*.clickDistance for setting the click distance threshold.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Add module entry point to package.json.
module entry point to package.json.The drag behavior d3.behavior.drag has been renamed to d3.drag. The _drag_.origin method has been replaced by _drag_.subject, which allows you to defi
The drag behavior d3.behavior.drag has been renamed to d3.drag. The drag.origin method has been replaced by drag.subject, which allows you to define the thing being dragged at the start of a drag gesture. This is particularly useful with Canvas, where draggable objects typically share a Canvas element (as opposed to SVG, where draggable objects typically have distinct DOM elements); see the circle dragging example.
A new drag.container method lets you override the parent element that defines the drag gesture coordinate system. This defaults to the parent node of the element to which the drag behavior was applied. For dragging on Canvas elements, you probably want to use the Canvas element as the container.
Drag events now expose an event.on method for registering temporary listeners for duration of the current drag gesture; these listeners can capture state for the current gesture, such as the thing being dragged. A new event.active property lets you detect whether multiple (multitouch) drag gestures are active concurrently. The dragstart and dragend events have been renamed to start and end. By default, drag behaviors now ignore right-clicks intended for the context menu; use drag.filter to control which events are ignored. The drag behavior also ignores emulated mouse events on iOS. The drag behavior now consumes handled events, making it easier to combine with other interactive behaviors such as zooming.
The new d3.dragEnable and d3.dragDisable methods provide a low-level API for implementing drag gestures across browsers and devices. These methods are also used by other D3 components, such as the brush.
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).Only consume handled touch events.
- Add _event_.target.
The d3.drag constructor no longer takes an optional _started_ listener (#23).
Use the pointer coordinates as the default subject if the initiating datum is undefined (#18).
Add d3.dragDisable and d3.dragEnable (#22).
Events consumed by the drag behavior no longer propagate.
- Add _event_.active.
The default subject no longer falls back to the element if the datum is undefined.
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →