Comparing version 0.3.1 to 1.0.0
@@ -1,2 +0,2 @@ | ||
// https://d3js.org/d3-drag/ Version 0.3.1. Copyright 2016 Mike Bostock. | ||
// https://d3js.org/d3-drag/ Version 1.0.0. Copyright 2016 Mike Bostock. | ||
(function (global, factory) { | ||
@@ -3,0 +3,0 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-dispatch'), require('d3-selection')) : |
@@ -1,2 +0,2 @@ | ||
// https://d3js.org/d3-drag/ Version 0.3.1. Copyright 2016 Mike Bostock. | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("d3-dispatch"),require("d3-selection")):"function"==typeof define&&define.amd?define(["exports","d3-dispatch","d3-selection"],t):t(e.d3=e.d3||{},e.d3,e.d3)}(this,function(e,t,n){"use strict";function o(){n.event.stopImmediatePropagation()}function i(){n.event.preventDefault(),n.event.stopImmediatePropagation()}function r(e){var t=e.document.documentElement,o=n.select(e).on("dragstart.drag",i,!0);"onselectstart"in t?o.on("selectstart.drag",i,!0):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function u(e,t){var o=e.document.documentElement,r=n.select(e).on("dragstart.drag",null);t&&(r.on("click.drag",i,!0),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in o?r.on("selectstart.drag",null):(o.style.MozUserSelect=o.__noselect,delete o.__noselect)}function c(e){return function(){return e}}function s(e,t,n,o,i,r,u,c,s,a){this.target=e,this.type=t,this.subject=n,this.identifier=o,this.active=i,this.x=r,this.y=u,this.dx=c,this.dy=s,this._=a}function a(){return!n.event.button}function d(){return this.parentNode}function l(e){return null==e?{x:n.event.x,y:n.event.y}:e}function f(){function e(e){e.on("mousedown.drag",f).on("touchstart.drag",g).on("touchmove.drag",v).on("touchend.drag touchcancel.drag",m).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(){if(!_&&w.apply(this,arguments)){var e=y("mouse",x.apply(this,arguments),n.mouse,this,arguments);e&&(n.select(n.event.view).on("mousemove.drag",h,!0).on("mouseup.drag",p,!0),r(n.event.view),o(),b=!1,e("start"))}}function h(){i(),b=!0,j.mouse("drag")}function p(){n.select(n.event.view).on("mousemove.drag mouseup.drag",null),u(n.event.view,b),i(),j.mouse("end")}function g(){if(w.apply(this,arguments)){var e,t,i=n.event.changedTouches,r=x.apply(this,arguments),u=i.length;for(e=0;u>e;++e)(t=y(i[e].identifier,r,n.touch,this,arguments))&&(o(),t("start"))}}function v(){var e,t,o=n.event.changedTouches,r=o.length;for(e=0;r>e;++e)(t=j[o[e].identifier])&&(i(),t("drag"))}function m(){var e,t,i=n.event.changedTouches,r=i.length;for(_&&clearTimeout(_),_=setTimeout(function(){_=null},500),e=0;r>e;++e)(t=j[i[e].identifier])&&(o(),t("end"))}function y(t,o,i,r,u){var c,a,d,l=i(o,t),f=E.copy();if(n.customEvent(new s(e,"beforestart",c,t,k,l[0],l[1],0,0,f),function(){return null==(n.event.subject=c=T.apply(r,u))?!1:(a=c.x-l[0]||0,d=c.y-l[1]||0,!0)}))return function h(p){var g,v=l;switch(p){case"start":j[t]=h,g=k++;break;case"end":delete j[t],--k;case"drag":l=i(o,t),g=k}n.customEvent(new s(e,p,c,t,g,l[0]+a,l[1]+d,l[0]-v[0],l[1]-v[1],f),f.apply,f,[p,r,u])}}var b,_,w=a,x=d,T=l,j={},E=t.dispatch("start","drag","end"),k=0;return e.filter=function(t){return arguments.length?(w="function"==typeof t?t:c(!!t),e):w},e.container=function(t){return arguments.length?(x="function"==typeof t?t:c(t),e):x},e.subject=function(t){return arguments.length?(T="function"==typeof t?t:c(t),e):T},e.on=function(){var t=E.on.apply(E,arguments);return t===E?e:t},e}s.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e},e.drag=f,e.dragDisable=r,e.dragEnable=u,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
// https://d3js.org/d3-drag/ Version 1.0.0. Copyright 2016 Mike Bostock. | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("d3-dispatch"),require("d3-selection")):"function"==typeof define&&define.amd?define(["exports","d3-dispatch","d3-selection"],t):t(e.d3=e.d3||{},e.d3,e.d3)}(this,function(e,t,n){"use strict";function o(){n.event.stopImmediatePropagation()}function i(){n.event.preventDefault(),n.event.stopImmediatePropagation()}function r(e){var t=e.document.documentElement,o=n.select(e).on("dragstart.drag",i,!0);"onselectstart"in t?o.on("selectstart.drag",i,!0):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function u(e,t){var o=e.document.documentElement,r=n.select(e).on("dragstart.drag",null);t&&(r.on("click.drag",i,!0),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in o?r.on("selectstart.drag",null):(o.style.MozUserSelect=o.__noselect,delete o.__noselect)}function c(e){return function(){return e}}function s(e,t,n,o,i,r,u,c,s,a){this.target=e,this.type=t,this.subject=n,this.identifier=o,this.active=i,this.x=r,this.y=u,this.dx=c,this.dy=s,this._=a}function a(){return!n.event.button}function d(){return this.parentNode}function l(e){return null==e?{x:n.event.x,y:n.event.y}:e}function f(){function e(e){e.on("mousedown.drag",f).on("touchstart.drag",g).on("touchmove.drag",v).on("touchend.drag touchcancel.drag",m).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(){if(!_&&w.apply(this,arguments)){var e=y("mouse",x.apply(this,arguments),n.mouse,this,arguments);e&&(n.select(n.event.view).on("mousemove.drag",h,!0).on("mouseup.drag",p,!0),r(n.event.view),o(),b=!1,e("start"))}}function h(){i(),b=!0,j.mouse("drag")}function p(){n.select(n.event.view).on("mousemove.drag mouseup.drag",null),u(n.event.view,b),i(),j.mouse("end")}function g(){if(w.apply(this,arguments)){var e,t,i=n.event.changedTouches,r=x.apply(this,arguments),u=i.length;for(e=0;e<u;++e)(t=y(i[e].identifier,r,n.touch,this,arguments))&&(o(),t("start"))}}function v(){var e,t,o=n.event.changedTouches,r=o.length;for(e=0;e<r;++e)(t=j[o[e].identifier])&&(i(),t("drag"))}function m(){var e,t,i=n.event.changedTouches,r=i.length;for(_&&clearTimeout(_),_=setTimeout(function(){_=null},500),e=0;e<r;++e)(t=j[i[e].identifier])&&(o(),t("end"))}function y(t,o,i,r,u){var c,a,d,l=i(o,t),f=E.copy();if(n.customEvent(new s(e,"beforestart",c,t,k,l[0],l[1],0,0,f),function(){return null!=(n.event.subject=c=T.apply(r,u))&&(a=c.x-l[0]||0,d=c.y-l[1]||0,!0)}))return function h(p){var g,v=l;switch(p){case"start":j[t]=h,g=k++;break;case"end":delete j[t],--k;case"drag":l=i(o,t),g=k}n.customEvent(new s(e,p,c,t,g,l[0]+a,l[1]+d,l[0]-v[0],l[1]-v[1],f),f.apply,f,[p,r,u])}}var b,_,w=a,x=d,T=l,j={},E=t.dispatch("start","drag","end"),k=0;return e.filter=function(t){return arguments.length?(w="function"==typeof t?t:c(!!t),e):w},e.container=function(t){return arguments.length?(x="function"==typeof t?t:c(t),e):x},e.subject=function(t){return arguments.length?(T="function"==typeof t?t:c(t),e):T},e.on=function(){var t=E.on.apply(E,arguments);return t===E?e:t},e}s.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e},e.drag=f,e.dragDisable=r,e.dragEnable=u,Object.defineProperty(e,"__esModule",{value:!0})}); |
{ | ||
"name": "d3-drag", | ||
"version": "0.3.1", | ||
"version": "1.0.0", | ||
"description": "Drag and drop SVG, HTML or Canvas using mouse or touch input.", | ||
@@ -28,7 +28,7 @@ "keywords": [ | ||
"prepublish": "npm run test && uglifyjs --preamble \"$(preamble)\" build/d3-drag.js -c -m -o build/d3-drag.min.js", | ||
"postpublish": "VERSION=`node -e 'console.log(require(\"./package.json\").version)'`; git push && git push --tags && cp build/d3-drag.js ../d3.github.com/d3-drag.v0.3.js && cp build/d3-drag.min.js ../d3.github.com/d3-drag.v0.3.min.js && cd ../d3.github.com && git add d3-drag.v0.3.js d3-drag.v0.3.min.js && git commit -m \"d3-drag ${VERSION}\" && git push && cd - && zip -j build/d3-drag.zip -- LICENSE README.md build/d3-drag.js build/d3-drag.min.js" | ||
"postpublish": "VERSION=`node -e 'console.log(require(\"./package.json\").version)'`; git push && git push --tags && cp build/d3-drag.js ../d3.github.com/d3-drag.v1.js && cp build/d3-drag.min.js ../d3.github.com/d3-drag.v1.min.js && cd ../d3.github.com && git add d3-drag.v1.js d3-drag.v1.min.js && git commit -m \"d3-drag ${VERSION}\" && git push && cd - && zip -j build/d3-drag.zip -- LICENSE README.md build/d3-drag.js build/d3-drag.min.js" | ||
}, | ||
"dependencies": { | ||
"d3-dispatch": "1", | ||
"d3-selection": "~0.9.0" | ||
"d3-selection": "1" | ||
}, | ||
@@ -38,3 +38,3 @@ "devDependencies": { | ||
"package-preamble": "0.0", | ||
"rollup": "0.31", | ||
"rollup": "0.33", | ||
"tape": "4", | ||
@@ -41,0 +41,0 @@ "uglify-js": "2" |
@@ -19,8 +19,8 @@ # d3-drag | ||
If you use NPM, `npm install d3-drag`. Otherwise, download the [latest release](https://github.com/d3/d3-drag/releases/latest). You can also load directly from [d3js.org](https://d3js.org), either as a [standalone library](https://d3js.org/d3-drag.v0.3.min.js) or as part of [D3 4.0](https://github.com/d3/d3). AMD, CommonJS, and vanilla environments are supported. In vanilla, a `d3` global is exported: | ||
If you use NPM, `npm install d3-drag`. Otherwise, download the [latest release](https://github.com/d3/d3-drag/releases/latest). You can also load directly from [d3js.org](https://d3js.org), either as a [standalone library](https://d3js.org/d3-drag.v1.min.js) or as part of [D3 4.0](https://github.com/d3/d3). AMD, CommonJS, and vanilla environments are supported. In vanilla, a `d3` global is exported: | ||
```html | ||
<script src="https://d3js.org/d3-dispatch.v1.min.js"></script> | ||
<script src="https://d3js.org/d3-selection.v0.9.min.js"></script> | ||
<script src="https://d3js.org/d3-drag.v0.3.min.js"></script> | ||
<script src="https://d3js.org/d3-selection.v1.min.js"></script> | ||
<script src="https://d3js.org/d3-drag.v1.min.js"></script> | ||
<script> | ||
@@ -27,0 +27,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
210135
+ Addedd3-selection@1.4.2(transitive)
- Removedd3-selection@0.9.0(transitive)
Updatedd3-selection@1