[d3-zoom/d3-drag] Update to version 1.2/1.1, respectively (#16470)

* [d3-zoom] Update to version 1.2
* [Feature] Add support of `clickDistance(...)`
* [Chore] Bump version number.

* [d3-drag] Update to version 1.1
* [Feature] Add support for `clickDistance(...)`
* [Chore] Minor version bump
This commit is contained in:
Tom Wanzek
2017-05-12 10:13:00 -04:00
committed by Andy
parent 96ae5a8560
commit 5a67cd51b9
4 changed files with 44 additions and 4 deletions

View File

@@ -88,6 +88,12 @@ circleDrag = circleDrag
containerAccessor = circleDrag.container();
// clickDistance(...) ---------------------------------------------------------
circleDrag = circleDrag.clickDistance(5);
const distance: number = circleDrag.clickDistance();
// set and get filter ---------------------------------------------------------
let filterFn: (this: SVGCircleElement, datum: CircleDatum, index: number, group: SVGCircleElement[] | NodeListOf<SVGCircleElement>) => boolean;

View File

@@ -1,9 +1,9 @@
// Type definitions for D3JS d3-drag module 1.0
// Type definitions for D3JS d3-drag module 1.1
// Project: https://github.com/d3/d3-drag/
// Definitions by: Tom Wanzek <https://github.com/tomwanzek>, Alex Ford <https://github.com/gustavderdrache>, Boris Yankov <https://github.com/borisyankov>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Last module patch version validated against: 1.0.2
// Last module patch version validated against: 1.1.0
import { ArrayLike, Selection, ValueFn } from 'd3-selection';
@@ -164,6 +164,20 @@ export interface DragBehavior<GElement extends DraggedElementBaseType, Datum, Su
*/
subject(accessor: ValueFn<GElement, Datum, Subject>): this;
/**
* Return the current click distance threshold, which defaults to zero.
*/
clickDistance(): number;
/**
* Set the maximum distance that the mouse can move between mousedown and mouseup that will trigger
* a subsequent click event. If at any point between mousedown and mouseup the mouse is greater than or equal to
* distance from its position on mousedown, the click event follwing mouseup will be suppressed.
*
* @param distance The distance threshold between mousedown and mouseup measured in client coordinates (event.clientX and event.clientY).
* The default is zero.
*/
clickDistance(distance: number): this;
/**
* Return the first currently-assigned listener matching the specified typenames, if any.
*

View File

@@ -165,6 +165,12 @@ svgZoom = svgZoom.translateExtent([[-500, -500], [500, 500]]);
let translateExtent: [[number, number], [number, number]];
translateExtent = svgZoom.translateExtent();
// clickDistance() ---------------------------------------------------------
svgZoom = svgZoom.clickDistance(5);
const distance: number = svgZoom.clickDistance();
// duration() --------------------------------------------------------------
// chainable

View File

@@ -1,9 +1,9 @@
// Type definitions for d3JS d3-zoom module 1.1
// Type definitions for d3JS d3-zoom module 1.2
// Project: https://github.com/d3/d3-zoom/
// Definitions by: Tom Wanzek <https://github.com/tomwanzek>, Alex Ford <https://github.com/gustavderdrache>, Boris Yankov <https://github.com/borisyankov>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Last module patch version validated against: 1.1.1
// Last module patch version validated against: 1.2.0
import { ArrayLike, Selection, TransitionLike, ValueFn } from 'd3-selection';
import { ZoomView, ZoomInterpolator } from 'd3-interpolate';
@@ -461,6 +461,20 @@ export interface ZoomBehavior<ZoomRefElement extends ZoomedElementBaseType, Datu
*/
translateExtent(extent: [[number, number], [number, number]]): this;
/**
* Return the current click distance threshold, which defaults to zero.
*/
clickDistance(): number;
/**
* Set the maximum distance that the mouse can move between mousedown and mouseup that will trigger
* a subsequent click event. If at any point between mousedown and mouseup the mouse is greater than or equal to
* distance from its position on mousedown, the click event follwing mouseup will be suppressed.
*
* @param distance The distance threshold between mousedown and mouseup measured in client coordinates (event.clientX and event.clientY).
* The default is zero.
*/
clickDistance(distance: number): this;
/**
* Get the duration for zoom transitions on double-click and double-tap in milliseconds.
*/