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 0.3.0 to 0.3.1

2

build/d3-drag.js

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

// https://d3js.org/d3-drag/ Version 0.3.0. Copyright 2016 Mike Bostock.
// https://d3js.org/d3-drag/ Version 0.3.1. 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.0. Copyright 2016 Mike Bostock.
// 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})});
{
"name": "d3-drag",
"version": "0.3.0",
"version": "0.3.1",
"description": "Drag and drop SVG, HTML or Canvas using mouse or touch input.",
"keywords": [
"d3",
"d3-module",
"drag",

@@ -30,4 +31,4 @@ "behavior",

"dependencies": {
"d3-dispatch": "~0.5.0",
"d3-selection": "~0.8.0"
"d3-dispatch": "1",
"d3-selection": "~0.9.0"
},

@@ -37,3 +38,3 @@ "devDependencies": {

"package-preamble": "0.0",
"rollup": "0.27",
"rollup": "0.31",
"tape": "4",

@@ -40,0 +41,0 @@ "uglify-js": "2"

@@ -22,4 +22,4 @@ # d3-drag

```html
<script src="https://d3js.org/d3-dispatch.v0.5.min.js"></script>
<script src="https://d3js.org/d3-selection.v0.8.min.js"></script>
<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>

@@ -26,0 +26,0 @@ <script>

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