Skip to content

Commit

Permalink
Merge pull request #205 from d3/two
Browse files Browse the repository at this point in the history
Update d3-selection
  • Loading branch information
Fil authored Aug 23, 2020
2 parents c609de4 + 28bb791 commit c2fa604
Show file tree
Hide file tree
Showing 11 changed files with 1,505 additions and 546 deletions.
116 changes: 60 additions & 56 deletions README.md

Large diffs are not rendered by default.

16 changes: 10 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"name": "d3-zoom",
"version": "1.8.3",
"version": "2.0.0-rc.1",
"publishConfig": {
"tag": "next"
},
"description": "Pan and zoom SVG, HTML or Canvas using mouse or touch input.",
"keywords": [
"d3",
Expand Down Expand Up @@ -34,14 +37,15 @@
"postpublish": "git push && git push --tags && cd ../d3.github.com && git pull && cp ../${npm_package_name}/dist/${npm_package_name}.js ${npm_package_name}.v${npm_package_version%%.*}.js && cp ../${npm_package_name}/dist/${npm_package_name}.min.js ${npm_package_name}.v${npm_package_version%%.*}.min.js && git add ${npm_package_name}.v${npm_package_version%%.*}.js ${npm_package_name}.v${npm_package_version%%.*}.min.js && git commit -m \"${npm_package_name} ${npm_package_version}\" && git push && cd - && zip -j dist/${npm_package_name}.zip -- LICENSE README.md dist/${npm_package_name}.js dist/${npm_package_name}.min.js"
},
"dependencies": {
"d3-dispatch": "1",
"d3-drag": "1",
"d3-interpolate": "1",
"d3-selection": "1",
"d3-transition": "1"
"d3-dispatch": ">=2.0.0-rc.1",
"d3-drag": ">=2.0.0-rc.1",
"d3-interpolate": ">=2.0.0-rc.1",
"d3-selection": ">=2.0.0-rc.3",
"d3-transition": ">=2.0.0-rc.3"
},
"devDependencies": {
"eslint": "6",
"jsdom": "^16.2.2",
"rollup": "1",
"rollup-plugin-terser": "5",
"tape": "4"
Expand Down
6 changes: 1 addition & 5 deletions src/constant.js
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
export default function(x) {
return function() {
return x;
};
}
export default x => () => x;
17 changes: 13 additions & 4 deletions src/event.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
export default function ZoomEvent(target, type, transform) {
this.target = target;
this.type = type;
this.transform = transform;
export default function ZoomEvent(type, {
sourceEvent,
target,
transform,
dispatch
}) {
Object.defineProperties(this, {
type: {value: type, enumerable: true, configurable: true},
sourceEvent: {value: sourceEvent, enumerable: true, configurable: true},
target: {value: target, enumerable: true, configurable: true},
transform: {value: transform, enumerable: true, configurable: true},
_: {value: dispatch}
});
}
6 changes: 2 additions & 4 deletions src/noevent.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import {event} from "d3-selection";

export function nopropagation() {
export function nopropagation(event) {
event.stopImmediatePropagation();
}

export default function() {
export default function(event) {
event.preventDefault();
event.stopImmediatePropagation();
}
Loading

0 comments on commit c2fa604

Please sign in to comment.