Socket
Socket
Sign inDemoInstall

d3-selection

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

d3-selection - npm Package Compare versions

Comparing version 0.4.10 to 0.4.11

45

build/selection.cjs.js

@@ -11,3 +11,3 @@ 'use strict';

exports.event$1 = null;
exports.event = null;

@@ -69,9 +69,9 @@ if (typeof document !== "undefined") {

return function(event1) {
var i = ancestors.length, event0 = exports.event$1; // Events can be reentrant (e.g., focus).
var i = ancestors.length, event0 = exports.event; // Events can be reentrant (e.g., focus).
while (--i >= 0) args[i << 1] = ancestors[i].__data__;
exports.event$1 = event1;
exports.event = event1;
try {
listener.apply(ancestors[0], args);
} finally {
exports.event$1 = event0;
exports.event = event0;
}

@@ -93,3 +93,3 @@ };

function sourceEvent() {
var current = exports.event$1, source;
var current = exports.event, source;
while (source = current.sourceEvent) current = source;

@@ -1008,11 +1008,13 @@ return current;

function touches(node, touches) {
if (arguments.length < 2) touches = sourceEvent().touches;
for (var i = 0, n = touches ? touches.length : 0, points = new Array(n); i < n; ++i) {
points[i] = point(node, touches[i]);
}
return points;
function mouse(node, event) {
if (arguments.length < 2) event = sourceEvent();
if (event.changedTouches) event = event.changedTouches[0];
return point(node, event);
};
function touch$1(node, touches, identifier) {
function selectAll(selector) {
return new Selection(typeof selector === "string" ? document.querySelectorAll(selector) : selector, 1);
};
function touch(node, touches, identifier) {
if (arguments.length < 3) identifier = touches, touches = sourceEvent().changedTouches;

@@ -1027,13 +1029,10 @@ for (var i = 0, n = touches ? touches.length : 0, touch; i < n; ++i) {

function selectAll(selector) {
return new Selection(typeof selector === "string" ? document.querySelectorAll(selector) : selector, 1);
function touches(node, touches) {
if (arguments.length < 2) touches = sourceEvent().touches;
for (var i = 0, n = touches ? touches.length : 0, points = new Array(n); i < n; ++i) {
points[i] = point(node, touches[i]);
}
return points;
};
function mouse(node, event) {
if (arguments.length < 2) event = sourceEvent();
if (event.changedTouches) event = event.changedTouches[0];
return point(node, event);
};
exports.event = exports.event$1;
exports.mouse = mouse;

@@ -1046,3 +1045,3 @@ exports.namespace = namespace;

exports.selection = selection;
exports.touch = touch$1;
exports.touches = touches;
exports.touch = touch;
exports.touches = touches;

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

(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
factory((global.selection = {}));
}(this, function (exports) { 'use strict';
!function(global, exports) {
"use strict";

@@ -15,3 +12,3 @@ var requoteRe = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;

exports.event$1 = null;
exports.event = null;

@@ -73,9 +70,9 @@ if (typeof document !== "undefined") {

return function(event1) {
var i = ancestors.length, event0 = exports.event$1; // Events can be reentrant (e.g., focus).
var i = ancestors.length, event0 = exports.event; // Events can be reentrant (e.g., focus).
while (--i >= 0) args[i << 1] = ancestors[i].__data__;
exports.event$1 = event1;
exports.event = event1;
try {
listener.apply(ancestors[0], args);
} finally {
exports.event$1 = event0;
exports.event = event0;
}

@@ -97,3 +94,3 @@ };

function sourceEvent() {
var current = exports.event$1, source;
var current = exports.event, source;
while (source = current.sourceEvent) current = source;

@@ -1012,11 +1009,13 @@ return current;

function touches(node, touches) {
if (arguments.length < 2) touches = sourceEvent().touches;
for (var i = 0, n = touches ? touches.length : 0, points = new Array(n); i < n; ++i) {
points[i] = point(node, touches[i]);
}
return points;
function mouse(node, event) {
if (arguments.length < 2) event = sourceEvent();
if (event.changedTouches) event = event.changedTouches[0];
return point(node, event);
};
function touch$1(node, touches, identifier) {
function selectAll(selector) {
return new Selection(typeof selector === "string" ? document.querySelectorAll(selector) : selector, 1);
};
function touch(node, touches, identifier) {
if (arguments.length < 3) identifier = touches, touches = sourceEvent().changedTouches;

@@ -1031,13 +1030,10 @@ for (var i = 0, n = touches ? touches.length : 0, touch; i < n; ++i) {

function selectAll(selector) {
return new Selection(typeof selector === "string" ? document.querySelectorAll(selector) : selector, 1);
function touches(node, touches) {
if (arguments.length < 2) touches = sourceEvent().touches;
for (var i = 0, n = touches ? touches.length : 0, points = new Array(n); i < n; ++i) {
points[i] = point(node, touches[i]);
}
return points;
};
function mouse(node, event) {
if (arguments.length < 2) event = sourceEvent();
if (event.changedTouches) event = event.changedTouches[0];
return point(node, event);
};
exports.event = exports.event$1;
exports.mouse = mouse;

@@ -1050,5 +1046,9 @@ exports.namespace = namespace;

exports.selection = selection;
exports.touch = touch$1;
exports.touch = touch;
exports.touches = touches;
exports.version = "0.4.11";
}));
if (typeof define === "function" && define.amd) global.selection = exports, define("selection", [], function() { return exports; });
else if (typeof module === "object" && module.exports) module.exports = exports;
else global.selection = exports;
}(this, {});

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

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.selection={})}(this,function(t){"use strict";function e(t){return t.replace(rt,"\\$&")}function n(t,n,a){function u(){for(var e=p,o=arguments.length>>1,u=new Array(o);--o>=0;)e=e[arguments[(o<<1)+1]],u[o]=o?e._parent:e;var c=r(n,u,arguments);l&&(c=i(c)),s.call(this),this.addEventListener(t,this[f]=c,c._capture=a),c._listener=n}function s(){var e=this[f];e&&(this.removeEventListener(t,e,e._capture),delete this[f])}function c(){var n,r=new RegExp("^__on([^.]+)"+e(t)+"$");for(var i in this)if(n=i.match(r)){var o=this[i];this.removeEventListener(n[1],o,o._capture),delete this[i]}}var l,h=arguments.length,f="__on"+t,p=this._root;return 2>h?(h=this.node()[f])&&h._listener:(3>h&&(a=!1),(h=t.indexOf("."))>0&&(t=t.slice(0,h)),(l=it.hasOwnProperty(t))&&(t=it[t]),this.each(n?h?u:o:h?s:c))}function r(e,n,r){return function(i){for(var o=n.length,a=t.event$1;--o>=0;)r[o<<1]=n[o].__data__;t.event$1=i;try{e.apply(n[0],r)}finally{t.event$1=a}}}function i(t){return function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t(e)}}function o(){}function a(){for(var e,n=t.event$1;e=n.sourceEvent;)n=e;return n}function u(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function s(t,e){function n(){return c(this,t,e)}function r(){return c(this,t,e.apply(this,arguments))}return this.each("function"==typeof e?r:n)}function c(t,e,n){var r=u(t),i=r.CustomEvent;i?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function l(t){return arguments.length?this.property("__data__",t):this.node().__data__}function h(){return this.each(function(){var t=this.parentNode;t&&t.removeChild(this)})}function f(t){var e=t.indexOf(":"),n=t;return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),at.hasOwnProperty(n)?{space:at[n],local:t}:t}function p(t){return function(){return this.querySelector(t)}}function _(t,e){function n(){return this.appendChild(t.apply(this,arguments))}function r(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)}return"function"!=typeof t&&(t=d(t)),this.select(arguments.length<2?n:("function"!=typeof e&&(e=p(e)),r))}function d(t){function e(){var e=this.ownerDocument,n=this.namespaceURI;return n?e.createElementNS(n,t):e.createElement(t)}function n(){return this.ownerDocument.createElementNS(t.space,t.local)}return t=f(t),t.local?n:e}function g(t){function e(){this.innerHTML=t}function n(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}return arguments.length?(null==t&&(t=""),this.each("function"==typeof t?n:e)):this.node().innerHTML}function v(t){function e(){this.textContent=t}function n(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}return arguments.length?(null==t&&(t=""),this.each("function"==typeof t?n:e)):this.node().textContent}function m(t,e){function n(){for(var n=-1;++n<i;)t[n](this,e)}function r(){for(var n=-1,r=e.apply(this,arguments);++n<i;)t[n](this,r)}t=(t+"").trim().split(/^|\s+/);var i=t.length;if(arguments.length<2){var o=this.node(),a=-1;if(e=o.classList){for(;++a<i;)if(!e.contains(t[a]))return!1}else for(e=o.getAttribute("class");++a<i;)if(!A(t[a]).test(e))return!1;return!0}return t=t.map(y),this.each("function"==typeof e?r:n)}function y(t){var e;return function(n,r){if(i=n.classList)return r?i.add(t):i.remove(t);e||(e=A(t));var i=n.getAttribute("class")||"";r?(e.lastIndex=0,e.test(i)||n.setAttribute("class",w(i+" "+t))):n.setAttribute("class",w(i.replace(e," ")))}}function w(t){return t.trim().replace(/\s+/g," ")}function A(t){return new RegExp("(?:^|\\s+)"+e(t)+"(?:\\s+|$)","g")}function x(t,e){function n(){delete this[t]}function r(){this[t]=e}function i(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}return arguments.length<2?this.node()[t]:this.each(null==e?n:"function"==typeof e?i:r)}function b(t,e,n){function r(){this.style.removeProperty(t)}function i(){this.style.setProperty(t,e,n)}function o(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}var a=arguments.length;return 2>a?u(a=this.node()).getComputedStyle(a,null).getPropertyValue(t):(3>a&&(n=""),this.each(null==e?r:"function"==typeof e?o:i))}function S(t,e){function n(){this.removeAttribute(t)}function r(){this.removeAttributeNS(t.space,t.local)}function i(){this.setAttribute(t,e)}function o(){this.setAttributeNS(t.space,t.local,e)}function a(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}function u(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}if(t=f(t),arguments.length<2){var s=this.node();return t.local?s.getAttributeNS(t.space,t.local):s.getAttribute(t)}return this.each(null==e?t.local?r:n:"function"==typeof e?t.local?u:a:t.local?o:i)}function E(t){function e(n,i){var o,a=-1,u=n.length;if(--i)for(var s=2*i,c=s+1;++a<u;)(o=n[a])&&(r[s]=o._parent.__data__,r[c]=a,e(o,i));else for(;++a<u;)(o=n[a])&&(r[0]=o.__data__,r[1]=a,t.apply(o,r))}var n=this._depth,r=new Array(n);return e(this._root,n),this}function C(){return!this.node()}function M(){var t=0;return this.each(function(){++t}),t}function N(){return T(this._root,this._depth)}function T(t,e){var n,r=-1,i=t.length;if(--e){for(;++r<i;)if((n=t[r])&&(n=T(n,e)))return n}else for(;++r<i;)if(n=t[r])return n}function $(){var t=new Array(this.size()),e=-1;return this.each(function(){t[++e]=this}),t}function L(){var t=arguments[0];return t.apply(arguments[0]=this,arguments),this}function P(t){return t._root=D(t._root,t._depth)}function D(t,e){var n,r=-1,i=t.length;if(--e)for(;++r<i;)(n=t[r])&&(t[r]=D(n,e));else if(!Array.isArray(t)){for(var o=new Array(i);++r<i;)o[r]=t[r];o._parent=t._parent,t=o}return t}function V(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}function n(t,r){if(--r)for(var i,o=-1,a=t.length;++o<a;)(i=t[o])&&n(i,r);else t.sort(e)}return t||(t=B),n(P(this),this._depth),this.order()}function B(t,e){return e>t?-1:t>e?1:t>=e?0:NaN}function R(){return q(this._root,this._depth),this}function q(t,e){var n,r,i=t.length;if(--e)for(;--i>=0;)(n=t[i])&&q(n,e);else for(r=t[--i];--i>=0;)(n=t[i])&&(r&&r!==n.nextSibling&&r.parentNode.insertBefore(n,r),r=n)}function X(t){return new W(z(P(t),t._depth),t._depth)}function z(t,e){var n,r=-1,i=t.length,o=new Array(i);if(--e)for(;++r<i;)(n=t[r])&&(o[r]=z(n,e));return o._parent=t._parent,o}function I(){return this._exit||(this._exit=X(this))}function O(){return this._enter||(this._enter=X(this),this._enter._update=this),this._enter}function Y(t,e){function n(e,r,i,o){var a,u,l=-1;if(o--){var h=2*o,f=h+1;for(a=e.length;++l<a;)(u=e[l])&&(s[h]=u._parent.__data__,s[f]=l,n(u,r[l],i[l],o))}else{var p,_=0;for(c(e,r,i,t.apply(e._parent,s)),a=e.length;++l<a;)if(p=r[l]){for(l>=_&&(_=l+1);!(u=e[_])&&++_<a;);p._next=u||null}}}function r(t,e,n,r){var i,o=0,a=t.length,u=r.length,s=Math.min(a,u);for(e.length=0,e.length=u,n.length=0,n.length=a;s>o;++o)(i=t[o])?i.__data__=r[o]:e[o]=new k(t._parent,r[o]);for(;u>o;++o)e[o]=new k(t._parent,r[o]);for(;a>o;++o)(i=t[o])&&(n[o]=t[o]);t.length=u}function i(t,n,r,i){var o,a,u,c=i.length,l=t.length,h={},f=new Array(2).concat(s),p=new Array(l);for(n.length=0,n.length=c,r.length=0,r.length=l,o=0;l>o;++o)(a=t[o])&&(f[0]=a.__data__,f[1]=o,p[o]=u=ut+e.apply(a,f),h[u]?r[o]=a:h[u]=a);for(t.length=0,t.length=c,o=0;c>o;++o)f[0]=i[o],f[1]=o,u=ut+e.apply(t._parent,f),(a=h[u])?a!==!0&&(t[o]=a,a.__data__=i[o]):n[o]=new k(t._parent,i[o]),h[u]=!0;for(o=0;l>o;++o)(a=h[p[o]])!==!0&&(r[o]=a)}if(!t){var o=new Array(this.size()),a=-1;return this.each(function(t){o[++a]=t}),o}var u=this._depth-1,s=new Array(2*u),c=e?i:r;return"function"!=typeof t&&(t=G(t)),n(this._root,this.enter()._root,this.exit()._root,u),this}function k(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function G(t){return function(){return t}}function H(t){function e(n,i){var o,a,u=-1,s=n.length;if(--i){var c=2*i,l=c+1;for(a=new Array(s);++u<s;)(o=n[u])&&(r[c]=o._parent.__data__,r[l]=u,a[u]=e(o,i))}else for(a=[];++u<s;)(o=n[u])&&(r[0]=o.__data__,r[1]=u,t.apply(o,r)&&a.push(o));return a._parent=n._parent,a}var n=this._depth,r=new Array(2*n);return"function"!=typeof t&&(t=st(t)),new W(e(this._root,n),n)}function U(t){function e(n,i){var o,a,u=-1,s=n.length,c=new Array(s);if(--i)for(var l=2*i,h=l+1;++u<s;)(o=n[u])&&(r[l]=o._parent.__data__,r[h]=u,c[u]=e(o,i));else for(;++u<s;)(o=n[u])&&(r[0]=o.__data__,r[1]=u,c[u]=a=t.apply(o,r),a._parent=o);return c._parent=n._parent,c}var n=this._depth,r=new Array(2*n);return"function"!=typeof t&&(t=j(t)),new W(e(this._root,n),n+1)}function j(t){return function(){return this.querySelectorAll(t)}}function K(t){function e(n,i,o){var a,u,s=-1,c=n.length,l=new Array(c);if(--o)for(var h=2*o,f=h+1;++s<c;)(a=n[s])&&(r[h]=a._parent.__data__,r[f]=s,l[s]=e(a,i&&i[s],o));else for(;++s<c;)(a=n[s])&&(r[0]=a.__data__,r[1]=s,(u=t.apply(a,r))&&("__data__"in a&&(u.__data__=a.__data__),i&&(i[s]=u,delete n[s]),l[s]=u));return l._parent=n._parent,l}var n=this._depth,r=new Array(2*n);return"function"!=typeof t&&(t=p(t)),new W(e(this._root,this._update&&this._update._root,n),n)}function W(t,e){this._root=t,this._depth=e,this._enter=this._update=this._exit=null}function F(){return new W([document.documentElement],1)}function J(t){return new W(["string"==typeof t?document.querySelector(t):t],1)}function Q(t,e){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();if(0>ht){var i=defaultView(t);if(i.scrollX||i.scrollY){n=J(i.document.body).append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var o=n.node().getScreenCTM();ht=!(o.f||o.e),n.remove()}}return ht?(r.x=e.pageX,r.y=e.pageY):(r.x=e.clientX,r.y=e.clientY),r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}var a=t.getBoundingClientRect();return[e.clientX-a.left-t.clientLeft,e.clientY-a.top-t.clientTop]}function Z(t,e){arguments.length<2&&(e=a().touches);for(var n=0,r=e?e.length:0,i=new Array(r);r>n;++n)i[n]=Q(t,e[n]);return i}function tt(t,e,n){arguments.length<3&&(n=e,e=a().changedTouches);for(var r,i=0,o=e?e.length:0;o>i;++i)if((r=e[i]).identifier===n)return Q(t,r);return null}function et(t){return new W("string"==typeof t?document.querySelectorAll(t):t,1)}function nt(t,e){return arguments.length<2&&(e=a()),e.changedTouches&&(e=e.changedTouches[0]),Q(t,e)}var rt=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,it={};if(t.event$1=null,"undefined"!=typeof document){var ot=document.documentElement;"onmouseenter"in ot||(it={mouseenter:"mouseover",mouseleave:"mouseout"})}var at={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},ut="$";k.prototype={appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e||this._next)}};var st=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var ct=document.documentElement;if(!ct.matches){var lt=ct.webkitMatchesSelector||ct.msMatchesSelector||ct.mozMatchesSelector||ct.oMatchesSelector;st=function(t){return function(){return lt.call(this,t)}}}}W.prototype=F.prototype={select:K,selectAll:U,filter:H,data:Y,enter:O,exit:I,order:R,sort:V,call:L,nodes:$,node:N,size:M,empty:C,each:E,attr:S,style:b,property:x,"class":m,classed:m,text:v,html:g,append:_,insert:_,remove:h,datum:l,event:n,on:n,dispatch:s};var ht="undefined"!=typeof navigator&&/WebKit/.test(navigator.userAgent)?-1:0;t.event=t.event$1,t.mouse=nt,t.namespace=f,t.namespaces=at,t.requote=e,t.select=J,t.selectAll=et,t.selection=F,t.touch=tt,t.touches=Z});
!function(t,e){"use strict";function n(t){return t.replace(it,"\\$&")}function r(t,e,r){function u(){for(var n=p,a=arguments.length>>1,u=new Array(a);--a>=0;)n=n[arguments[(a<<1)+1]],u[a]=a?n._parent:n;var c=i(e,u,arguments);l&&(c=o(c)),s.call(this),this.addEventListener(t,this[f]=c,c._capture=r),c._listener=e}function s(){var e=this[f];e&&(this.removeEventListener(t,e,e._capture),delete this[f])}function c(){var e,r=new RegExp("^__on([^.]+)"+n(t)+"$");for(var i in this)if(e=i.match(r)){var o=this[i];this.removeEventListener(e[1],o,o._capture),delete this[i]}}var l,h=arguments.length,f="__on"+t,p=this._root;return 2>h?(h=this.node()[f])&&h._listener:(3>h&&(r=!1),(h=t.indexOf("."))>0&&(t=t.slice(0,h)),(l=ot.hasOwnProperty(t))&&(t=ot[t]),this.each(e?h?u:a:h?s:c))}function i(t,n,r){return function(i){for(var o=n.length,a=e.event;--o>=0;)r[o<<1]=n[o].__data__;e.event=i;try{t.apply(n[0],r)}finally{e.event=a}}}function o(t){return function(e){var n=e.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||t(e)}}function a(){}function u(){for(var t,n=e.event;t=n.sourceEvent;)n=t;return n}function s(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function c(t,e){function n(){return l(this,t,e)}function r(){return l(this,t,e.apply(this,arguments))}return this.each("function"==typeof e?r:n)}function l(t,e,n){var r=s(t),i=r.CustomEvent;i?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function h(t){return arguments.length?this.property("__data__",t):this.node().__data__}function f(){return this.each(function(){var t=this.parentNode;t&&t.removeChild(this)})}function p(t){var e=t.indexOf(":"),n=t;return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),ut.hasOwnProperty(n)?{space:ut[n],local:t}:t}function _(t){return function(){return this.querySelector(t)}}function d(t,e){function n(){return this.appendChild(t.apply(this,arguments))}function r(){return this.insertBefore(t.apply(this,arguments),e.apply(this,arguments)||null)}return"function"!=typeof t&&(t=g(t)),this.select(arguments.length<2?n:("function"!=typeof e&&(e=_(e)),r))}function g(t){function e(){var e=this.ownerDocument,n=this.namespaceURI;return n?e.createElementNS(n,t):e.createElement(t)}function n(){return this.ownerDocument.createElementNS(t.space,t.local)}return t=p(t),t.local?n:e}function m(t){function e(){this.innerHTML=t}function n(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}return arguments.length?(null==t&&(t=""),this.each("function"==typeof t?n:e)):this.node().innerHTML}function v(t){function e(){this.textContent=t}function n(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}return arguments.length?(null==t&&(t=""),this.each("function"==typeof t?n:e)):this.node().textContent}function y(t,e){function n(){for(var n=-1;++n<i;)t[n](this,e)}function r(){for(var n=-1,r=e.apply(this,arguments);++n<i;)t[n](this,r)}t=(t+"").trim().split(/^|\s+/);var i=t.length;if(arguments.length<2){var o=this.node(),a=-1;if(e=o.classList){for(;++a<i;)if(!e.contains(t[a]))return!1}else for(e=o.getAttribute("class");++a<i;)if(!x(t[a]).test(e))return!1;return!0}return t=t.map(w),this.each("function"==typeof e?r:n)}function w(t){var e;return function(n,r){if(i=n.classList)return r?i.add(t):i.remove(t);e||(e=x(t));var i=n.getAttribute("class")||"";r?(e.lastIndex=0,e.test(i)||n.setAttribute("class",A(i+" "+t))):n.setAttribute("class",A(i.replace(e," ")))}}function A(t){return t.trim().replace(/\s+/g," ")}function x(t){return new RegExp("(?:^|\\s+)"+n(t)+"(?:\\s+|$)","g")}function b(t,e){function n(){delete this[t]}function r(){this[t]=e}function i(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}return arguments.length<2?this.node()[t]:this.each(null==e?n:"function"==typeof e?i:r)}function S(t,e,n){function r(){this.style.removeProperty(t)}function i(){this.style.setProperty(t,e,n)}function o(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}var a=arguments.length;return 2>a?s(a=this.node()).getComputedStyle(a,null).getPropertyValue(t):(3>a&&(n=""),this.each(null==e?r:"function"==typeof e?o:i))}function E(t,e){function n(){this.removeAttribute(t)}function r(){this.removeAttributeNS(t.space,t.local)}function i(){this.setAttribute(t,e)}function o(){this.setAttributeNS(t.space,t.local,e)}function a(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}function u(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}if(t=p(t),arguments.length<2){var s=this.node();return t.local?s.getAttributeNS(t.space,t.local):s.getAttribute(t)}return this.each(null==e?t.local?r:n:"function"==typeof e?t.local?u:a:t.local?o:i)}function C(t){function e(n,i){var o,a=-1,u=n.length;if(--i)for(var s=2*i,c=s+1;++a<u;)(o=n[a])&&(r[s]=o._parent.__data__,r[c]=a,e(o,i));else for(;++a<u;)(o=n[a])&&(r[0]=o.__data__,r[1]=a,t.apply(o,r))}var n=this._depth,r=new Array(n);return e(this._root,n),this}function M(){return!this.node()}function N(){var t=0;return this.each(function(){++t}),t}function T(){return L(this._root,this._depth)}function L(t,e){var n,r=-1,i=t.length;if(--e){for(;++r<i;)if((n=t[r])&&(n=L(n,e)))return n}else for(;++r<i;)if(n=t[r])return n}function P(){var t=new Array(this.size()),e=-1;return this.each(function(){t[++e]=this}),t}function D(){var t=arguments[0];return t.apply(arguments[0]=this,arguments),this}function V(t){return t._root=B(t._root,t._depth)}function B(t,e){var n,r=-1,i=t.length;if(--e)for(;++r<i;)(n=t[r])&&(t[r]=B(n,e));else if(!Array.isArray(t)){for(var o=new Array(i);++r<i;)o[r]=t[r];o._parent=t._parent,t=o}return t}function R(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}function n(t,r){if(--r)for(var i,o=-1,a=t.length;++o<a;)(i=t[o])&&n(i,r);else t.sort(e)}return t||(t=q),n(V(this),this._depth),this.order()}function q(t,e){return e>t?-1:t>e?1:t>=e?0:NaN}function X(){return $(this._root,this._depth),this}function $(t,e){var n,r,i=t.length;if(--e)for(;--i>=0;)(n=t[i])&&$(n,e);else for(r=t[--i];--i>=0;)(n=t[i])&&(r&&r!==n.nextSibling&&r.parentNode.insertBefore(n,r),r=n)}function z(t){return new F(I(V(t),t._depth),t._depth)}function I(t,e){var n,r=-1,i=t.length,o=new Array(i);if(--e)for(;++r<i;)(n=t[r])&&(o[r]=I(n,e));return o._parent=t._parent,o}function O(){return this._exit||(this._exit=z(this))}function Y(){return this._enter||(this._enter=z(this),this._enter._update=this),this._enter}function k(t,e){function n(e,r,i,o){var a,u,l=-1;if(o--){var h=2*o,f=h+1;for(a=e.length;++l<a;)(u=e[l])&&(s[h]=u._parent.__data__,s[f]=l,n(u,r[l],i[l],o))}else{var p,_=0;for(c(e,r,i,t.apply(e._parent,s)),a=e.length;++l<a;)if(p=r[l]){for(l>=_&&(_=l+1);!(u=e[_])&&++_<a;);p._next=u||null}}}function r(t,e,n,r){var i,o=0,a=t.length,u=r.length,s=Math.min(a,u);for(e.length=0,e.length=u,n.length=0,n.length=a;s>o;++o)(i=t[o])?i.__data__=r[o]:e[o]=new G(t._parent,r[o]);for(;u>o;++o)e[o]=new G(t._parent,r[o]);for(;a>o;++o)(i=t[o])&&(n[o]=t[o]);t.length=u}function i(t,n,r,i){var o,a,u,c=i.length,l=t.length,h={},f=new Array(2).concat(s),p=new Array(l);for(n.length=0,n.length=c,r.length=0,r.length=l,o=0;l>o;++o)(a=t[o])&&(f[0]=a.__data__,f[1]=o,p[o]=u=st+e.apply(a,f),h[u]?r[o]=a:h[u]=a);for(t.length=0,t.length=c,o=0;c>o;++o)f[0]=i[o],f[1]=o,u=st+e.apply(t._parent,f),(a=h[u])?a!==!0&&(t[o]=a,a.__data__=i[o]):n[o]=new G(t._parent,i[o]),h[u]=!0;for(o=0;l>o;++o)(a=h[p[o]])!==!0&&(r[o]=a)}if(!t){var o=new Array(this.size()),a=-1;return this.each(function(t){o[++a]=t}),o}var u=this._depth-1,s=new Array(2*u),c=e?i:r;return"function"!=typeof t&&(t=H(t)),n(this._root,this.enter()._root,this.exit()._root,u),this}function G(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function H(t){return function(){return t}}function U(t){function e(n,i){var o,a,u=-1,s=n.length;if(--i){var c=2*i,l=c+1;for(a=new Array(s);++u<s;)(o=n[u])&&(r[c]=o._parent.__data__,r[l]=u,a[u]=e(o,i))}else for(a=[];++u<s;)(o=n[u])&&(r[0]=o.__data__,r[1]=u,t.apply(o,r)&&a.push(o));return a._parent=n._parent,a}var n=this._depth,r=new Array(2*n);return"function"!=typeof t&&(t=ct(t)),new F(e(this._root,n),n)}function j(t){function e(n,i){var o,a,u=-1,s=n.length,c=new Array(s);if(--i)for(var l=2*i,h=l+1;++u<s;)(o=n[u])&&(r[l]=o._parent.__data__,r[h]=u,c[u]=e(o,i));else for(;++u<s;)(o=n[u])&&(r[0]=o.__data__,r[1]=u,c[u]=a=t.apply(o,r),a._parent=o);return c._parent=n._parent,c}var n=this._depth,r=new Array(2*n);return"function"!=typeof t&&(t=K(t)),new F(e(this._root,n),n+1)}function K(t){return function(){return this.querySelectorAll(t)}}function W(t){function e(n,i,o){var a,u,s=-1,c=n.length,l=new Array(c);if(--o)for(var h=2*o,f=h+1;++s<c;)(a=n[s])&&(r[h]=a._parent.__data__,r[f]=s,l[s]=e(a,i&&i[s],o));else for(;++s<c;)(a=n[s])&&(r[0]=a.__data__,r[1]=s,(u=t.apply(a,r))&&("__data__"in a&&(u.__data__=a.__data__),i&&(i[s]=u,delete n[s]),l[s]=u));return l._parent=n._parent,l}var n=this._depth,r=new Array(2*n);return"function"!=typeof t&&(t=_(t)),new F(e(this._root,this._update&&this._update._root,n),n)}function F(t,e){this._root=t,this._depth=e,this._enter=this._update=this._exit=null}function J(){return new F([document.documentElement],1)}function Q(t){return new F(["string"==typeof t?document.querySelector(t):t],1)}function Z(t,e){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();if(0>ft){var i=defaultView(t);if(i.scrollX||i.scrollY){n=Q(i.document.body).append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var o=n.node().getScreenCTM();ft=!(o.f||o.e),n.remove()}}return ft?(r.x=e.pageX,r.y=e.pageY):(r.x=e.clientX,r.y=e.clientY),r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}var a=t.getBoundingClientRect();return[e.clientX-a.left-t.clientLeft,e.clientY-a.top-t.clientTop]}function tt(t,e){return arguments.length<2&&(e=u()),e.changedTouches&&(e=e.changedTouches[0]),Z(t,e)}function et(t){return new F("string"==typeof t?document.querySelectorAll(t):t,1)}function nt(t,e,n){arguments.length<3&&(n=e,e=u().changedTouches);for(var r,i=0,o=e?e.length:0;o>i;++i)if((r=e[i]).identifier===n)return Z(t,r);return null}function rt(t,e){arguments.length<2&&(e=u().touches);for(var n=0,r=e?e.length:0,i=new Array(r);r>n;++n)i[n]=Z(t,e[n]);return i}var it=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,ot={};if(e.event=null,"undefined"!=typeof document){var at=document.documentElement;"onmouseenter"in at||(ot={mouseenter:"mouseover",mouseleave:"mouseout"})}var ut={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},st="$";G.prototype={appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e||this._next)}};var ct=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var lt=document.documentElement;if(!lt.matches){var ht=lt.webkitMatchesSelector||lt.msMatchesSelector||lt.mozMatchesSelector||lt.oMatchesSelector;ct=function(t){return function(){return ht.call(this,t)}}}}F.prototype=J.prototype={select:W,selectAll:j,filter:U,data:k,enter:Y,exit:O,order:X,sort:R,call:D,nodes:P,node:T,size:N,empty:M,each:C,attr:E,style:S,property:b,"class":y,classed:y,text:v,html:m,append:d,insert:d,remove:f,datum:h,event:r,on:r,dispatch:c};var ft="undefined"!=typeof navigator&&/WebKit/.test(navigator.userAgent)?-1:0;e.mouse=tt,e.namespace=p,e.namespaces=ut,e.requote=n,e.select=Q,e.selectAll=et,e.selection=J,e.touch=nt,e.touches=rt,e.version="0.4.11","function"==typeof define&&define.amd?(t.selection=e,define("selection",[],function(){return e})):"object"==typeof module&&module.exports?module.exports=e:t.selection=e}(this,{});

@@ -1,23 +0,10 @@

import mouse from "./src/mouse";
import namespace from "./src/namespace";
import namespaces from "./src/namespaces";
import requote from "./src/requote";
import select from "./src/select";
import selectAll from "./src/selectAll";
import selection from "./src/selection";
import touch from "./src/touch";
import touches from "./src/touches";
import {event} from "./src/selection-event"
export {
event,
mouse,
namespace,
namespaces,
requote,
select,
selectAll,
selection,
touch,
touches
};
export {default as mouse} from "./src/mouse";
export {default as namespace} from "./src/namespace";
export {default as namespaces} from "./src/namespaces";
export {default as requote} from "./src/requote";
export {default as select} from "./src/select";
export {default as selectAll} from "./src/selectAll";
export {default as selection} from "./src/selection";
export {default as touch} from "./src/touch";
export {default as touches} from "./src/touches";
export {event} from "./src/selection-event"
{
"name": "d3-selection",
"version": "0.4.10",
"version": "0.4.11",
"description": "Data-driven DOM manipulation: select elements and join them to data.",

@@ -29,3 +29,3 @@ "keywords": [

"devDependencies": {
"d3-bundler": "~0.4.0",
"d3-bundler": "~0.4.2",
"faucet": "0.0",

@@ -32,0 +32,0 @@ "jsdom": "7",

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