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.6.6 to 0.6.7

2

build/bundle.js

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

var version = "0.6.6"; export * from "../index"; export {version};
var version = "0.6.7"; export * from "../index"; export {version};

@@ -7,2 +7,62 @@ (function (global, factory) {

var namespaces = {
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/"
};
function namespace(name) {
var prefix = name += "", i = prefix.indexOf(":");
if (i >= 0 && (prefix = name.slice(0, i)) !== "xmlns") name = name.slice(i + 1);
return namespaces.hasOwnProperty(prefix) ? {space: namespaces[prefix], local: name} : name;
}
function creatorInherit(name) {
return function() {
var document = this.ownerDocument,
uri = this.namespaceURI;
return uri && uri !== document.documentElement.namespaceURI
? document.createElementNS(uri, name)
: document.createElement(name);
};
}
function creatorFixed(fullname) {
return function() {
return this.ownerDocument.createElementNS(fullname.space, fullname.local);
};
}
function creator(name) {
var fullname = namespace(name);
return (fullname.local
? creatorFixed
: creatorInherit)(fullname);
}
var matcher = function(selector) {
return function() {
return this.matches(selector);
};
};
if (typeof document !== "undefined") {
var element = document.documentElement;
if (!element.matches) {
var vendorMatches = element.webkitMatchesSelector
|| element.msMatchesSelector
|| element.mozMatchesSelector
|| element.oMatchesSelector;
matcher = function(selector) {
return function() {
return vendorMatches.call(this, selector);
};
};
}
}
var matcher$1 = matcher;
var requoteRe = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;

@@ -21,4 +81,4 @@

if (typeof document !== "undefined") {
var element = document.documentElement;
if (!("onmouseenter" in element)) {
var element$1 = document.documentElement;
if (!("onmouseenter" in element$1)) {
filterEvents = {mouseenter: "mouseover", mouseleave: "mouseout"};

@@ -155,25 +215,2 @@ }

var matcher = function(selector) {
return function() {
return this.matches(selector);
};
};
if (typeof document !== "undefined") {
var element$1 = document.documentElement;
if (!element$1.matches) {
var vendorMatches = element$1.webkitMatchesSelector
|| element$1.msMatchesSelector
|| element$1.mozMatchesSelector
|| element$1.oMatchesSelector;
matcher = function(selector) {
return function() {
return vendorMatches.call(this, selector);
};
};
}
}
var matcher$1 = matcher;
function selection_filter(match) {

@@ -462,16 +499,2 @@ if (typeof match !== "function") match = matcher$1(match);

var namespaces = {
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/"
};
function namespace(name) {
var prefix = name += "", i = prefix.indexOf(":");
if (i >= 0 && (prefix = name.slice(0, i)) !== "xmlns") name = name.slice(i + 1);
return namespaces.hasOwnProperty(prefix) ? {space: namespaces[prefix], local: name} : name;
}
function attrRemove(name) {

@@ -738,25 +761,2 @@ return function() {

function creatorInherit(name) {
return function() {
var document = this.ownerDocument,
uri = this.namespaceURI;
return uri && uri !== document.documentElement.namespaceURI
? document.createElementNS(uri, name)
: document.createElement(name);
};
}
function creatorFixed(fullname) {
return function() {
return this.ownerDocument.createElementNS(fullname.space, fullname.local);
};
}
function creator(name) {
var fullname = namespace(name);
return (fullname.local
? creatorFixed
: creatorInherit)(fullname);
}
function append(create) {

@@ -946,5 +946,7 @@ return function() {

var version = "0.6.6";
var version = "0.6.7";
exports.version = version;
exports.creator = creator;
exports.matcher = matcher$1;
exports.mouse = mouse;

@@ -956,2 +958,4 @@ exports.namespace = namespace;

exports.selection = selection;
exports.selector = selector;
exports.selectorAll = selectorAll;
exports.touch = touch;

@@ -958,0 +962,0 @@ exports.touches = touches;

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

!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(t.d3_selection={})}(this,function(t){"use strict";function n(t){return t.replace(zt,"\\$&")}function e(){}function r(n,e,r){return function(i){var u=t.event;t.event=i;try{n.call(this,this.__data__,e,r)}finally{t.event=u}}}function i(t){return function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t(n)}}function u(t,n){return function(){var e=this[t];e&&(this.removeEventListener(n,e,e._capture),delete this[t])}}function o(t){var e=new RegExp("^__on([^.]+)"+n(t)+"$");return function(){for(var t in this){var n=t.match(e);if(n){var r=this[t];this.removeEventListener(n[1],r,r._capture),delete this[t]}}}}function s(t,n,e,u,o){return function(s,a,c){var l=this[n];l&&this.removeEventListener(e,l,l._capture),l=r(u,a,c),t&&(l=i(l)),l._listener=u,this.addEventListener(e,this[n]=l,l._capture=o)}}function a(t,n,r){var i,a,c=t+"",l="__on"+c;return arguments.length<2?(i=this.node()[l])&&i._listener:((i=c.indexOf("."))>0&&(c=c.slice(0,i)),(a=Ht.hasOwnProperty(c))&&(c=Ht[c]),this.each(n?i?s(a,l,c,n,null==r?!1:r):e:i?u(l,c):o(c)))}function c(){for(var n,e=t.event;n=e.sourceEvent;)e=n;return e}function l(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function h(t){return function(){return this.querySelector(t)}}function f(t){"function"!=typeof t&&(t=h(t));for(var n=this._groups,e=this._update,r=n.length,i=new Array(r),u=0;r>u;++u)for(var o,s,a=n[u],c=a.length,l=i[u]=new Array(c),f=0;c>f;++f)(o=a[f])&&(s=t.call(o,o.__data__,f,a))&&("__data__"in o&&(s.__data__=o.__data__),e&&(e._groups[u][f]=s),l[f]=s);return new Pt(i,this._parents)}function p(t){return function(){return this.querySelectorAll(t)}}function _(t){"function"!=typeof t&&(t=p(t));for(var n=this._groups,e=n.length,r=[],i=[],u=0;e>u;++u)for(var o,s=n[u],a=s.length,c=0;a>c;++c)(o=s[c])&&(r.push(t.call(o,o.__data__,c,s)),i.push(o));return new Pt(r,i)}function m(t){"function"!=typeof t&&(t=jt(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;e>i;++i)for(var u,o=n[i],s=o.length,a=r[i]=[],c=0;s>c;++c)(u=o[c])&&t.call(u,u.__data__,c,o)&&a.push(u);return new Pt(r,this._parents)}function d(t){for(var n=t._groups,e=0,r=n.length;r>e;++e)if(!Array.isArray(i=n[e]))for(var i,u=i.length,o=n[e]=new Array(u),s=0;u>s;++s)o[s]=i[s];return n}function g(t){return function(){return t}}function v(t,n,e,r,i){var u,o=0,s=n.length,a=i.length,c=Math.min(s,a);for(e.length=0,e.length=a,r.length=0,r.length=s;c>o;++o)(u=n[o])?u.__data__=i[o]:e[o]=new x(t,i[o]);for(;a>o;++o)e[o]=new x(t,i[o]);for(;s>o;++o)(u=n[o])&&(r[o]=n[o]);n.length=a}function y(t,n,e,r,i,u){var o,s,a,c=i.length,l=n.length,h={},f=new Array(l);for(e.length=0,e.length=c,r.length=0,r.length=l,o=0;l>o;++o)(s=n[o])&&(f[o]=a=kt+u.call(s,s.__data__,o,n),h[a]?r[o]=s:h[a]=s);for(n.length=0,n.length=c,o=0;c>o;++o)a=kt+u.call(t,i[o],o,i),(s=h[a])?s!==!0&&(n[o]=s,s.__data__=i[o]):e[o]=new x(t,i[o]),h[a]=!0;for(o=0;l>o;++o)(s=h[f[o]])!==!0&&(r[o]=s)}function w(t,n){if(!t){var e=new Array(this.size()),r=-1;return this.each(function(t){e[++r]=t}),e}var i=n?y:v,u=this._parents,o=d(this),s=(this._enter=this.enter())._groups,a=(this._exit=this.exit())._groups;"function"!=typeof t&&(t=g(t));for(var c=o.length,l=0;c>l;++l){var h=o[l],f=u[l];i(f,h,s[l],a[l],t.call(f,f&&f.__data__,l,u),n);for(var p,_,m=h.length,w=0,x=0;m>w;++w)if(p=s[l][w]){for(w>=x&&(x=w+1);!(_=h[x])&&++x<m;);p._next=_||null}}return this}function x(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function A(t){return new Array(t.length)}function S(){var t=this._enter;return t?(this._enter=null,t):(t=new Pt(this._groups.map(A),this._parents),t._update=this,t)}function b(){var t=this._exit;return t?(this._exit=null,t):new Pt(this._groups.map(A),this._parents)}function E(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,i=t[n],u=i.length-1,o=i[u];--u>=0;)(r=i[u])&&(o&&o!==r.nextSibling&&o.parentNode.insertBefore(r,o),o=r);return this}function C(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=N);for(var e=d(this),r=0,i=e.length;i>r;++r)e[r].sort(n);return this.order()}function N(t,n){return n>t?-1:t>n?1:t>=n?0:NaN}function M(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function T(){var t=new Array(this.size()),n=-1;return this.each(function(){t[++n]=this}),t}function L(){for(var t=this._groups,n=0,e=t.length;e>n;++n)for(var r=t[n],i=0,u=r.length;u>i;++i){var o=r[i];if(o)return o}return null}function P(){var t=0;return this.each(function(){++t}),t}function q(){return!this.node()}function B(t){for(var n=this._groups,e=0,r=n.length;r>e;++e)for(var i,u=n[e],o=0,s=u.length;s>o;++o)(i=u[o])&&t.call(i,i.__data__,o,u);return this}function D(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),Gt.hasOwnProperty(n)?{space:Gt[n],local:t}:t}function O(t){return function(){this.removeAttribute(t)}}function R(t){return function(){this.removeAttributeNS(t.space,t.local)}}function V(t,n){return function(){this.setAttribute(t,n)}}function X(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function z(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function H(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function I(t,n){var e=D(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((null==n?e.local?R:O:"function"==typeof n?e.local?H:z:e.local?X:V)(e,n))}function U(t){return function(){this.style.removeProperty(t)}}function Y(t,n,e){return function(){this.style.setProperty(t,n,e)}}function $(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function j(t,n,e){var r;return arguments.length>1?this.each((null==n?U:"function"==typeof n?$:Y)(t,n,null==e?"":e)):l(r=this.node()).getComputedStyle(r,null).getPropertyValue(t)}function k(t){return function(){delete this[t]}}function G(t,n){return function(){this[t]=n}}function K(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function W(t,n){return arguments.length>1?this.each((null==n?k:"function"==typeof n?K:G)(t,n)):this.node()[t]}function F(t){return t.trim().split(/^|\s+/)}function J(t){return t.classList||new Q(t)}function Q(t){this._node=t,this._names=F(t.getAttribute("class")||"")}function Z(t,n){for(var e=J(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function tt(t,n){for(var e=J(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function nt(t){return function(){Z(this,t)}}function et(t){return function(){tt(this,t)}}function rt(t,n){return function(){(n.apply(this,arguments)?Z:tt)(this,t)}}function it(t,n){var e=F(t+"");if(arguments.length<2){for(var r=J(this.node()),i=-1,u=e.length;++i<u;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?rt:n?nt:et)(e,n))}function ut(){this.textContent=""}function ot(t){return function(){this.textContent=t}}function st(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function at(t){return arguments.length?this.each(null==t?ut:("function"==typeof t?st:ot)(t)):this.node().textContent}function ct(){this.innerHTML=""}function lt(t){return function(){this.innerHTML=t}}function ht(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function ft(t){return arguments.length?this.each(null==t?ct:("function"==typeof t?ht:lt)(t)):this.node().innerHTML}function pt(){this.parentNode.appendChild(this)}function _t(){return this.each(pt)}function mt(){this.parentNode.insertBefore(this,this.parentNode.firstChild)}function dt(){return this.each(mt)}function gt(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e&&e!==n.documentElement.namespaceURI?n.createElementNS(e,t):n.createElement(t)}}function vt(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function yt(t){var n=D(t);return(n.local?vt:gt)(n)}function wt(t){return function(){return this.appendChild(t.apply(this,arguments))}}function xt(t,n){return function(){return this.insertBefore(t.apply(this,arguments),n.apply(this,arguments)||null)}}function At(){return null}function St(t,n){var e="function"==typeof t?t:yt(t);return this.select(arguments.length<2?wt(e):xt(e,null==n?At:"function"==typeof n?n:h(n)))}function bt(){var t=this.parentNode;t&&t.removeChild(this)}function Et(){return this.each(bt)}function Ct(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Nt(t,n,e){var r=l(t),i=r.CustomEvent;i?i=new i(n,e):(i=r.document.createEvent("Event"),e?(i.initEvent(n,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(n,!1,!1)),t.dispatchEvent(i)}function Mt(t,n){return function(){return Nt(this,t,n)}}function Tt(t,n){return function(){return Nt(this,t,n.apply(this,arguments))}}function Lt(t,n){return this.each(("function"==typeof n?Tt:Mt)(t,n))}function Pt(t,n){this._groups=t,this._parents=n}function qt(){return new Pt([[document.documentElement]],Kt)}function Bt(t){return"string"==typeof t?new Pt([[document.querySelector(t)]],[document.documentElement]):new Pt([[t]],Kt)}function Dt(t,n){var e=t.ownerSVGElement||t;if(e.createSVGPoint){var r=e.createSVGPoint();if(0>Wt){var i=l(t);if(i.scrollX||i.scrollY){e=Bt(i.document.body).append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var u=e.node().getScreenCTM();Wt=!(u.f||u.e),e.remove()}}return Wt?(r.x=n.pageX,r.y=n.pageY):(r.x=n.clientX,r.y=n.clientY),r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}var o=t.getBoundingClientRect();return[n.clientX-o.left-t.clientLeft,n.clientY-o.top-t.clientTop]}function Ot(t,n){return null==n&&(n=c()),n.changedTouches&&(n=n.changedTouches[0]),Dt(t,n)}function Rt(t){return"string"==typeof t?new Pt([document.querySelectorAll(t)],[document.documentElement]):new Pt([t],Kt)}function Vt(t,n,e){arguments.length<3&&(e=n,n=c().changedTouches);for(var r,i=0,u=n?n.length:0;u>i;++i)if((r=n[i]).identifier===e)return Dt(t,r);return null}function Xt(t,n){null==n&&(n=c().touches);for(var e=0,r=n?n.length:0,i=new Array(r);r>e;++e)i[e]=Dt(t,n[e]);return i}var zt=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,Ht={};if(t.event=null,"undefined"!=typeof document){var It=document.documentElement;"onmouseenter"in It||(Ht={mouseenter:"mouseover",mouseleave:"mouseout"})}var Ut=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var Yt=document.documentElement;if(!Yt.matches){var $t=Yt.webkitMatchesSelector||Yt.msMatchesSelector||Yt.mozMatchesSelector||Yt.oMatchesSelector;Ut=function(t){return function(){return $t.call(this,t)}}}}var jt=Ut,kt="$";x.prototype={appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};var Gt={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/"};Q.prototype={add:function(t){var n=this._names.indexOf(t);0>n&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var Kt=[null];Pt.prototype=qt.prototype={select:f,selectAll:_,filter:m,data:w,enter:S,exit:b,order:E,sort:C,call:M,nodes:T,node:L,size:P,empty:q,each:B,attr:I,style:j,property:W,classed:it,text:at,html:ft,raise:_t,lower:dt,append:St,remove:Et,datum:Ct,on:a,dispatch:Lt};var Wt="undefined"!=typeof navigator&&/WebKit/.test(navigator.userAgent)?-1:0,Ft="0.6.6";t.version=Ft,t.mouse=Ot,t.namespace=D,t.namespaces=Gt,t.select=Bt,t.selectAll=Rt,t.selection=qt,t.touch=Vt,t.touches=Xt});
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(t.d3_selection={})}(this,function(t){"use strict";function n(t){var n=t+="",e=n.indexOf(":");return e>=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),zt.hasOwnProperty(n)?{space:zt[n],local:t}:t}function e(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e&&e!==n.documentElement.namespaceURI?n.createElementNS(e,t):n.createElement(t)}}function r(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function i(t){var i=n(t);return(i.local?r:e)(i)}function u(t){return t.replace($t,"\\$&")}function o(){}function s(n,e,r){return function(i){var u=t.event;t.event=i;try{n.call(this,this.__data__,e,r)}finally{t.event=u}}}function a(t){return function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t(n)}}function c(t,n){return function(){var e=this[t];e&&(this.removeEventListener(n,e,e._capture),delete this[t])}}function l(t){var n=new RegExp("^__on([^.]+)"+u(t)+"$");return function(){for(var t in this){var e=t.match(n);if(e){var r=this[t];this.removeEventListener(e[1],r,r._capture),delete this[t]}}}}function h(t,n,e,r,i){return function(u,o,c){var l=this[n];l&&this.removeEventListener(e,l,l._capture),l=s(r,o,c),t&&(l=a(l)),l._listener=r,this.addEventListener(e,this[n]=l,l._capture=i)}}function f(t,n,e){var r,i,u=t+"",s="__on"+u;return arguments.length<2?(r=this.node()[s])&&r._listener:((r=u.indexOf("."))>0&&(u=u.slice(0,r)),(i=jt.hasOwnProperty(u))&&(u=jt[u]),this.each(n?r?h(i,s,u,n,null==e?!1:e):o:r?c(s,u):l(u)))}function p(){for(var n,e=t.event;n=e.sourceEvent;)e=n;return e}function _(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function m(t){return function(){return this.querySelector(t)}}function d(t){"function"!=typeof t&&(t=m(t));for(var n=this._groups,e=this._update,r=n.length,i=new Array(r),u=0;r>u;++u)for(var o,s,a=n[u],c=a.length,l=i[u]=new Array(c),h=0;c>h;++h)(o=a[h])&&(s=t.call(o,o.__data__,h,a))&&("__data__"in o&&(s.__data__=o.__data__),e&&(e._groups[u][h]=s),l[h]=s);return new Pt(i,this._parents)}function g(t){return function(){return this.querySelectorAll(t)}}function v(t){"function"!=typeof t&&(t=g(t));for(var n=this._groups,e=n.length,r=[],i=[],u=0;e>u;++u)for(var o,s=n[u],a=s.length,c=0;a>c;++c)(o=s[c])&&(r.push(t.call(o,o.__data__,c,s)),i.push(o));return new Pt(r,i)}function y(t){"function"!=typeof t&&(t=Yt(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;e>i;++i)for(var u,o=n[i],s=o.length,a=r[i]=[],c=0;s>c;++c)(u=o[c])&&t.call(u,u.__data__,c,o)&&a.push(u);return new Pt(r,this._parents)}function w(t){for(var n=t._groups,e=0,r=n.length;r>e;++e)if(!Array.isArray(i=n[e]))for(var i,u=i.length,o=n[e]=new Array(u),s=0;u>s;++s)o[s]=i[s];return n}function x(t){return function(){return t}}function A(t,n,e,r,i){var u,o=0,s=n.length,a=i.length,c=Math.min(s,a);for(e.length=0,e.length=a,r.length=0,r.length=s;c>o;++o)(u=n[o])?u.__data__=i[o]:e[o]=new E(t,i[o]);for(;a>o;++o)e[o]=new E(t,i[o]);for(;s>o;++o)(u=n[o])&&(r[o]=n[o]);n.length=a}function S(t,n,e,r,i,u){var o,s,a,c=i.length,l=n.length,h={},f=new Array(l);for(e.length=0,e.length=c,r.length=0,r.length=l,o=0;l>o;++o)(s=n[o])&&(f[o]=a=Gt+u.call(s,s.__data__,o,n),h[a]?r[o]=s:h[a]=s);for(n.length=0,n.length=c,o=0;c>o;++o)a=Gt+u.call(t,i[o],o,i),(s=h[a])?s!==!0&&(n[o]=s,s.__data__=i[o]):e[o]=new E(t,i[o]),h[a]=!0;for(o=0;l>o;++o)(s=h[f[o]])!==!0&&(r[o]=s)}function b(t,n){if(!t){var e=new Array(this.size()),r=-1;return this.each(function(t){e[++r]=t}),e}var i=n?S:A,u=this._parents,o=w(this),s=(this._enter=this.enter())._groups,a=(this._exit=this.exit())._groups;"function"!=typeof t&&(t=x(t));for(var c=o.length,l=0;c>l;++l){var h=o[l],f=u[l];i(f,h,s[l],a[l],t.call(f,f&&f.__data__,l,u),n);for(var p,_,m=h.length,d=0,g=0;m>d;++d)if(p=s[l][d]){for(d>=g&&(g=d+1);!(_=h[g])&&++g<m;);p._next=_||null}}return this}function E(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function C(t){return new Array(t.length)}function N(){var t=this._enter;return t?(this._enter=null,t):(t=new Pt(this._groups.map(C),this._parents),t._update=this,t)}function M(){var t=this._exit;return t?(this._exit=null,t):new Pt(this._groups.map(C),this._parents)}function T(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,i=t[n],u=i.length-1,o=i[u];--u>=0;)(r=i[u])&&(o&&o!==r.nextSibling&&o.parentNode.insertBefore(r,o),o=r);return this}function L(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=P);for(var e=w(this),r=0,i=e.length;i>r;++r)e[r].sort(n);return this.order()}function P(t,n){return n>t?-1:t>n?1:t>=n?0:NaN}function q(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function B(){var t=new Array(this.size()),n=-1;return this.each(function(){t[++n]=this}),t}function D(){for(var t=this._groups,n=0,e=t.length;e>n;++n)for(var r=t[n],i=0,u=r.length;u>i;++i){var o=r[i];if(o)return o}return null}function O(){var t=0;return this.each(function(){++t}),t}function R(){return!this.node()}function V(t){for(var n=this._groups,e=0,r=n.length;r>e;++e)for(var i,u=n[e],o=0,s=u.length;s>o;++o)(i=u[o])&&t.call(i,i.__data__,o,u);return this}function X(t){return function(){this.removeAttribute(t)}}function z(t){return function(){this.removeAttributeNS(t.space,t.local)}}function H(t,n){return function(){this.setAttribute(t,n)}}function I(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function U(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function Y(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function $(t,e){var r=n(t);if(arguments.length<2){var i=this.node();return r.local?i.getAttributeNS(r.space,r.local):i.getAttribute(r)}return this.each((null==e?r.local?z:X:"function"==typeof e?r.local?Y:U:r.local?I:H)(r,e))}function j(t){return function(){this.style.removeProperty(t)}}function k(t,n,e){return function(){this.style.setProperty(t,n,e)}}function G(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function K(t,n,e){var r;return arguments.length>1?this.each((null==n?j:"function"==typeof n?G:k)(t,n,null==e?"":e)):_(r=this.node()).getComputedStyle(r,null).getPropertyValue(t)}function W(t){return function(){delete this[t]}}function F(t,n){return function(){this[t]=n}}function J(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function Q(t,n){return arguments.length>1?this.each((null==n?W:"function"==typeof n?J:F)(t,n)):this.node()[t]}function Z(t){return t.trim().split(/^|\s+/)}function tt(t){return t.classList||new nt(t)}function nt(t){this._node=t,this._names=Z(t.getAttribute("class")||"")}function et(t,n){for(var e=tt(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function rt(t,n){for(var e=tt(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function it(t){return function(){et(this,t)}}function ut(t){return function(){rt(this,t)}}function ot(t,n){return function(){(n.apply(this,arguments)?et:rt)(this,t)}}function st(t,n){var e=Z(t+"");if(arguments.length<2){for(var r=tt(this.node()),i=-1,u=e.length;++i<u;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?ot:n?it:ut)(e,n))}function at(){this.textContent=""}function ct(t){return function(){this.textContent=t}}function lt(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function ht(t){return arguments.length?this.each(null==t?at:("function"==typeof t?lt:ct)(t)):this.node().textContent}function ft(){this.innerHTML=""}function pt(t){return function(){this.innerHTML=t}}function _t(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function mt(t){return arguments.length?this.each(null==t?ft:("function"==typeof t?_t:pt)(t)):this.node().innerHTML}function dt(){this.parentNode.appendChild(this)}function gt(){return this.each(dt)}function vt(){this.parentNode.insertBefore(this,this.parentNode.firstChild)}function yt(){return this.each(vt)}function wt(t){return function(){return this.appendChild(t.apply(this,arguments))}}function xt(t,n){return function(){return this.insertBefore(t.apply(this,arguments),n.apply(this,arguments)||null)}}function At(){return null}function St(t,n){var e="function"==typeof t?t:i(t);return this.select(arguments.length<2?wt(e):xt(e,null==n?At:"function"==typeof n?n:m(n)))}function bt(){var t=this.parentNode;t&&t.removeChild(this)}function Et(){return this.each(bt)}function Ct(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Nt(t,n,e){var r=_(t),i=r.CustomEvent;i?i=new i(n,e):(i=r.document.createEvent("Event"),e?(i.initEvent(n,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(n,!1,!1)),t.dispatchEvent(i)}function Mt(t,n){return function(){return Nt(this,t,n)}}function Tt(t,n){return function(){return Nt(this,t,n.apply(this,arguments))}}function Lt(t,n){return this.each(("function"==typeof n?Tt:Mt)(t,n))}function Pt(t,n){this._groups=t,this._parents=n}function qt(){return new Pt([[document.documentElement]],Kt)}function Bt(t){return"string"==typeof t?new Pt([[document.querySelector(t)]],[document.documentElement]):new Pt([[t]],Kt)}function Dt(t,n){var e=t.ownerSVGElement||t;if(e.createSVGPoint){var r=e.createSVGPoint();if(0>Wt){var i=_(t);if(i.scrollX||i.scrollY){e=Bt(i.document.body).append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var u=e.node().getScreenCTM();Wt=!(u.f||u.e),e.remove()}}return Wt?(r.x=n.pageX,r.y=n.pageY):(r.x=n.clientX,r.y=n.clientY),r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}var o=t.getBoundingClientRect();return[n.clientX-o.left-t.clientLeft,n.clientY-o.top-t.clientTop]}function Ot(t,n){return null==n&&(n=p()),n.changedTouches&&(n=n.changedTouches[0]),Dt(t,n)}function Rt(t){return"string"==typeof t?new Pt([document.querySelectorAll(t)],[document.documentElement]):new Pt([t],Kt)}function Vt(t,n,e){arguments.length<3&&(e=n,n=p().changedTouches);for(var r,i=0,u=n?n.length:0;u>i;++i)if((r=n[i]).identifier===e)return Dt(t,r);return null}function Xt(t,n){null==n&&(n=p().touches);for(var e=0,r=n?n.length:0,i=new Array(r);r>e;++e)i[e]=Dt(t,n[e]);return i}var zt={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/"},Ht=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var It=document.documentElement;if(!It.matches){var Ut=It.webkitMatchesSelector||It.msMatchesSelector||It.mozMatchesSelector||It.oMatchesSelector;Ht=function(t){return function(){return Ut.call(this,t)}}}}var Yt=Ht,$t=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,jt={};if(t.event=null,"undefined"!=typeof document){var kt=document.documentElement;"onmouseenter"in kt||(jt={mouseenter:"mouseover",mouseleave:"mouseout"})}var Gt="$";E.prototype={appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}},nt.prototype={add:function(t){var n=this._names.indexOf(t);0>n&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var Kt=[null];Pt.prototype=qt.prototype={select:d,selectAll:v,filter:y,data:b,enter:N,exit:M,order:T,sort:L,call:q,nodes:B,node:D,size:O,empty:R,each:V,attr:$,style:K,property:Q,classed:st,text:ht,html:mt,raise:gt,lower:yt,append:St,remove:Et,datum:Ct,on:f,dispatch:Lt};var Wt="undefined"!=typeof navigator&&/WebKit/.test(navigator.userAgent)?-1:0,Ft="0.6.7";t.version=Ft,t.creator=i,t.matcher=Yt,t.mouse=Ot,t.namespace=n,t.namespaces=zt,t.select=Bt,t.selectAll=Rt,t.selection=qt,t.selector=m,t.selectorAll=g,t.touch=Vt,t.touches=Xt});

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

export {default as creator} from "./src/creator";
export {default as matcher} from "./src/matcher";
export {default as mouse} from "./src/mouse";

@@ -7,4 +9,6 @@ export {default as namespace} from "./src/namespace";

export {default as selection} from "./src/selection/index";
export {default as selector} from "./src/selector";
export {default as selectorAll} from "./src/selectorAll";
export {default as touch} from "./src/touch";
export {default as touches} from "./src/touches";
export {event} from "./src/selection/on";
{
"name": "d3-selection",
"version": "0.6.6",
"version": "0.6.7",
"description": "Data-driven DOM manipulation: select elements and join them to data.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -145,2 +145,46 @@ # d3-selection

<a name="matcher" href="#matcher">#</a> d3.<b>matcher</b>(<i>selector</i>)
Given the specified *selector*, returns a function which returns true if `this` element [matches](https://developer.mozilla.org/en-US/docs/Web/API/Element/matches) the specified selector. This method is used internally by [*selection*.filter](#selection_filter). For example, this:
```js
var div = selection.filter("div");
```
Is equivalent to:
```js
var div = selection.filter(d3.matcher("div"));
```
(Although D3 is not a compatibility layer, this implementation does support vendor-prefixed implementations due to the recent standardization of *element*.matches.)
<a name="selector" href="#selector">#</a> d3.<b>selector</b>(<i>selector</i>)
Given the specified *selector*, returns a function which returns the first descendant of `this` element that matches the specified selector. This method is used internally by [*selection*.select](#selection_select). For example, this:
```js
var div = selection.select("div");
```
Is equivalent to:
```js
var div = selection.select(d3.selector("div"));
```
<a name="selectorAll" href="#selectorAll">#</a> d3.<b>selectorAll</b>(<i>selector</i>)
Given the specified *selector*, returns a function which returns all descendants of `this` element that match the specified selector. This method is used internally by [*selection*.selectAll](#selection_selectAll). For example, this:
```js
var div = selection.selectAll("div");
```
Is equivalent to:
```js
var div = selection.selectAll(d3.selectorAll("div"));
```
### Modifying Elements

@@ -278,2 +322,18 @@

<a name="creator" href="#creator">#</a> d3.<b>creator</b>(<i>name</i>)
Given the specified element *name*, returns a function which creates an element of the given name, assuming that `this` is the parent element. This method is used internally by [*selection*.append](#selection_append) to create new elements. For example, this:
```js
selection.append("div");
```
Is equivalent to:
```js
selection.append(d3.creator("div"));
```
See [namespace](#namespace) for details on supported namespace prefixes, such as for SVG elements.
### Joining Data

@@ -280,0 +340,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