Skip to content

Releases: d3/d3-drag

v1.0.4

10 Mar 18:10
Compare
Choose a tag to compare
  • Update dependencies.

v1.0.3

28 Feb 17:28
Compare
Choose a tag to compare
  • Update dependencies.

v1.0.2

23 Nov 00:30
Compare
Choose a tag to compare
  • Update dependencies.

v1.0.1

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

v1.0.0

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

Changes since D3 3.x

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.

v0.3.1

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

v0.3.0

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

v0.2.2

01 Jun 00:38
Compare
Choose a tag to compare
  • Only consume handled touch events.

v0.2.1

24 May 19:25
Compare
Choose a tag to compare

v0.2.0

24 May 15:45
Compare
Choose a tag to compare