Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

d3-drag

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d3-drag - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

8

build/d3-drag.js

@@ -1,6 +0,6 @@

// https://d3js.org/d3-drag/ Version 1.0.2. Copyright 2016 Mike Bostock.
// https://d3js.org/d3-drag/ Version 1.0.3. Copyright 2017 Mike Bostock.
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-dispatch'), require('d3-selection')) :
typeof define === 'function' && define.amd ? define(['exports', 'd3-dispatch', 'd3-selection'], factory) :
(factory((global.d3 = global.d3 || {}),global.d3,global.d3));
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-dispatch'), require('d3-selection')) :
typeof define === 'function' && define.amd ? define(['exports', 'd3-dispatch', 'd3-selection'], factory) :
(factory((global.d3 = global.d3 || {}),global.d3,global.d3));
}(this, (function (exports,d3Dispatch,d3Selection) { 'use strict';

@@ -7,0 +7,0 @@

@@ -1,2 +0,2 @@

// https://d3js.org/d3-drag/ Version 1.0.2. Copyright 2016 Mike Bostock.
// https://d3js.org/d3-drag/ Version 1.0.3. Copyright 2017 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 r(e,t){var o=e.document.documentElement,r=n.select(e).on("dragstart.drag",null);t&&(r.on("click.drag",a,!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 i(e,t,n,o,r,i,u,c,s,a){this.target=e,this.type=t,this.subject=n,this.identifier=o,this.active=r,this.x=i,this.y=u,this.dx=c,this.dy=s,this._=a}function u(){return!n.event.button}function c(){return this.parentNode}function s(e){return null==e?{x:n.event.x,y:n.event.y}:e}var a=function(){n.event.preventDefault(),n.event.stopImmediatePropagation()},d=function(e){var t=e.document.documentElement,o=n.select(e).on("dragstart.drag",a,!0);"onselectstart"in t?o.on("selectstart.drag",a,!0):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")},l=function(e){return function(){return e}};i.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};var f=function(){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),d(n.event.view),o(),b=!1,e("start"))}}function h(){a(),b=!0,j.mouse("drag")}function p(){n.select(n.event.view).on("mousemove.drag mouseup.drag",null),r(n.event.view,b),a(),j.mouse("end")}function g(){if(w.apply(this,arguments)){var e,t,r=n.event.changedTouches,i=x.apply(this,arguments),u=r.length;for(e=0;e<u;++e)(t=y(r[e].identifier,i,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])&&(a(),t("drag"))}function m(){var e,t,r=n.event.changedTouches,i=r.length;for(_&&clearTimeout(_),_=setTimeout(function(){_=null},500),e=0;e<i;++e)(t=j[r[e].identifier])&&(o(),t("end"))}function y(t,o,r,u,c){var s,a,d,l=r(o,t),f=E.copy();if(n.customEvent(new i(e,"beforestart",s,t,k,l[0],l[1],0,0,f),function(){return null!=(n.event.subject=s=T.apply(u,c))&&(a=s.x-l[0]||0,d=s.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=r(o,t),g=k}n.customEvent(new i(e,p,s,t,g,l[0]+a,l[1]+d,l[0]-v[0],l[1]-v[1],f),f.apply,f,[p,u,c])}}var b,_,w=u,x=c,T=s,j={},E=t.dispatch("start","drag","end"),k=0;return e.filter=function(t){return arguments.length?(w="function"==typeof t?t:l(!!t),e):w},e.container=function(t){return arguments.length?(x="function"==typeof t?t:l(t),e):x},e.subject=function(t){return arguments.length?(T="function"==typeof t?t:l(t),e):T},e.on=function(){var t=E.on.apply(E,arguments);return t===E?e:t},e};e.drag=f,e.dragDisable=d,e.dragEnable=r,Object.defineProperty(e,"__esModule",{value:!0})});
{
"name": "d3-drag",
"version": "1.0.2",
"version": "1.0.3",
"description": "Drag and drop SVG, HTML or Canvas using mouse or touch input.",

@@ -29,3 +29,3 @@ "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 && cd ../d3.github.com && git pull && cp ../d3-drag/build/d3-drag.js d3-drag.v1.js && cp ../d3-drag/build/d3-drag.min.js d3-drag.v1.min.js && 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"
"postpublish": "git push && git push --tags && cd ../d3.github.com && git pull && cp ../d3-drag/build/d3-drag.js d3-drag.v1.js && cp ../d3-drag/build/d3-drag.min.js d3-drag.v1.min.js && git add d3-drag.v1.js d3-drag.v1.min.js && git commit -m \"d3-drag ${npm_package_version}\" && git push && cd - && zip -j build/d3-drag.zip -- LICENSE README.md build/d3-drag.js build/d3-drag.min.js"
},

@@ -39,3 +39,3 @@ "dependencies": {

"package-preamble": "0.0",
"rollup": "0.36",
"rollup": "0.41",
"tape": "4",

@@ -42,0 +42,0 @@ "uglify-js": "2"

@@ -123,3 +123,3 @@ # d3-drag

function subject(d) {
return d == null ? {x: event.x, y: event.y} : d;
return d == null ? {x: d3.event.x, y: d3.event.y} : d;
}

@@ -126,0 +126,0 @@ ```

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc