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.8.0 to 0.9.0

6

build/d3-selection.js

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

// https://d3js.org/d3-selection/ Version 0.8.0. Copyright 2016 Mike Bostock.
// https://d3js.org/d3-selection/ Version 0.9.0. Copyright 2016 Mike Bostock.
(function (global, factory) {

@@ -278,5 +278,5 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :

for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, i = 0; i < n; ++i) {
for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {
if ((node = group[i]) && match.call(node, node.__data__, i, group)) {
subgroup[i] = node;
subgroup.push(node);
}

@@ -283,0 +283,0 @@ }

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

// https://d3js.org/d3-selection/ Version 0.8.0. Copyright 2016 Mike Bostock.
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(t.d3=t.d3||{})}(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)),Ht.hasOwnProperty(n)?{space:Ht[n],local:t}:t}function e(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===zt&&n.documentElement.namespaceURI===zt?n.createElement(t):n.createElementNS(e,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 o(){return new u}function u(){this._="@"+(++It).toString(36)}function c(t,n,e){return t=s(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function s(n,e,r){return function(i){var o=t.event;t.event=i;try{n.call(this,this.__data__,e,r)}finally{t.event=o}}}function a(t){return t.trim().split(/^|\s+/).map(function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}})}function l(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;o>r;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++i]=e:this.removeEventListener(e.type,e.listener,e.capture);++i?n.length=i:delete this.__on}}}function f(t,n,e){var r=Yt.hasOwnProperty(t.type)?c:s;return function(i,o,u){var c,s=this.__on,a=r(n,o,u);if(s)for(var l=0,f=s.length;f>l;++l)if((c=s[l]).type===t.type&&c.name===t.name)return this.removeEventListener(c.type,c.listener,c.capture),this.addEventListener(c.type,c.listener=a,c.capture=e),void(c.value=n);this.addEventListener(t.type,a,e),c={type:t.type,name:t.name,value:n,listener:a,capture:e},s?s.push(c):this.__on=[c]}}function h(t,n,e){var r,i,o=a(t+""),u=o.length;{if(!(arguments.length<2)){for(c=n?f:l,null==e&&(e=!1),r=0;u>r;++r)this.each(c(o[r],n,e));return this}var c=this.node().__on;if(c)for(var s,h=0,p=c.length;p>h;++h)for(r=0,s=c[h];u>r;++r)if((i=o[r]).type===s.type&&i.name===s.name)return s.value}}function p(n,e,r,i){var o=t.event;n.sourceEvent=t.event,t.event=n;try{return e.apply(r,i)}finally{t.event=o}}function _(){for(var n,e=t.event;n=e.sourceEvent;)e=n;return e}function v(t,n){var e=t.ownerSVGElement||t;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=n.clientX,r.y=n.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}var i=t.getBoundingClientRect();return[n.clientX-i.left-t.clientLeft,n.clientY-i.top-t.clientTop]}function d(t){var n=_();return n.changedTouches&&(n=n.changedTouches[0]),v(t,n)}function m(t){return function(){return this.querySelector(t)}}function y(t){"function"!=typeof t&&(t=m(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;e>i;++i)for(var o,u,c=n[i],s=c.length,a=r[i]=new Array(s),l=0;s>l;++l)(o=c[l])&&(u=t.call(o,o.__data__,l,c))&&("__data__"in o&&(u.__data__=o.__data__),a[l]=u);return new Ot(r,this._parents)}function g(t){return function(){return this.querySelectorAll(t)}}function w(t){"function"!=typeof t&&(t=g(t));for(var n=this._groups,e=n.length,r=[],i=[],o=0;e>o;++o)for(var u,c=n[o],s=c.length,a=0;s>a;++a)(u=c[a])&&(r.push(t.call(u,u.__data__,a,c)),i.push(u));return new Ot(r,i)}function A(t){"function"!=typeof t&&(t=Xt(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;e>i;++i)for(var o,u=n[i],c=u.length,s=r[i]=new Array(c),a=0;c>a;++a)(o=u[a])&&t.call(o,o.__data__,a,u)&&(s[a]=o);return new Ot(r,this._parents)}function x(t){return function(){return t}}function S(t,n,e,r,i,o){for(var u,c=0,s=n.length,a=o.length;a>c;++c)(u=n[c])?(u.__data__=o[c],r[c]=u):e[c]=new N(t,o[c]);for(;s>c;++c)(u=n[c])&&(i[c]=u)}function b(t,n,e,r,i,o,u){var c,s,a,l={},f=n.length,h=o.length,p=new Array(f);for(c=0;f>c;++c)(s=n[c])&&(p[c]=a=Ft+u.call(s,s.__data__,c,n),a in l?i[c]=s:l[a]=s);for(c=0;h>c;++c)a=Ft+u.call(t,o[c],c,o),(s=l[a])?(r[c]=s,s.__data__=o[c],l[a]=null):e[c]=new N(t,o[c]);for(c=0;f>c;++c)(s=n[c])&&l[p[c]]===s&&(i[c]=s)}function E(t,n){if(!t)return p=new Array(this.size()),a=-1,this.each(function(t){p[++a]=t}),p;var e=n?b:S,r=this._parents,i=this._groups;"function"!=typeof t&&(t=x(t));for(var o=i.length,u=new Array(o),c=new Array(o),s=new Array(o),a=0;o>a;++a){var l=r[a],f=i[a],h=f.length,p=t.call(l,l&&l.__data__,a,r),_=p.length,v=c[a]=new Array(_),d=u[a]=new Array(_),m=s[a]=new Array(h);e(l,f,v,d,m,p,n);for(var y,g,w=0,A=0;_>w;++w)if(y=v[w]){for(w>=A&&(A=w+1);!(g=d[A])&&++A<_;);y._next=g||null}}return u=new Ot(u,r),u._enter=c,u._exit=s,u}function N(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 M(){return new Ot(this._enter||this._groups.map(C),this._parents)}function L(){return new Ot(this._exit||this._groups.map(C),this._parents)}function P(t){for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),u=new Array(r),c=0;o>c;++c)for(var s,a=n[c],l=e[c],f=a.length,h=u[c]=new Array(f),p=0;f>p;++p)(s=a[p]||l[p])&&(h[p]=s);for(;r>c;++c)u[c]=n[c];return new Ot(u,this._parents)}function T(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,i=t[n],o=i.length-1,u=i[o];--o>=0;)(r=i[o])&&(u&&u!==r.nextSibling&&u.parentNode.insertBefore(r,u),u=r);return this}function q(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=O);for(var e=this._groups,r=e.length,i=new Array(r),o=0;r>o;++o){for(var u,c=e[o],s=c.length,a=i[o]=new Array(s),l=0;s>l;++l)(u=c[l])&&(a[l]=u);a.sort(n)}return new Ot(i,this._parents).order()}function O(t,n){return n>t?-1:t>n?1:t>=n?0:NaN}function B(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function D(){var t=new Array(this.size()),n=-1;return this.each(function(){t[++n]=this}),t}function V(){for(var t=this._groups,n=0,e=t.length;e>n;++n)for(var r=t[n],i=0,o=r.length;o>i;++i){var u=r[i];if(u)return u}return null}function R(){var t=0;return this.each(function(){++t}),t}function j(){return!this.node()}function z(t){for(var n=this._groups,e=0,r=n.length;r>e;++e)for(var i,o=n[e],u=0,c=o.length;c>u;++u)(i=o[u])&&t.call(i,i.__data__,u,o);return this}function H(t){return function(){this.removeAttribute(t)}}function I(t){return function(){this.removeAttributeNS(t.space,t.local)}}function U(t,n){return function(){this.setAttribute(t,n)}}function k(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function G(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function X(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 Y(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?I:H:"function"==typeof e?r.local?X:G:r.local?k:U)(r,e))}function $(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function F(t){return function(){this.style.removeProperty(t)}}function J(t,n,e){return function(){this.style.setProperty(t,n,e)}}function K(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function Q(t,n,e){var r;return arguments.length>1?this.each((null==n?F:"function"==typeof n?K:J)(t,n,null==e?"":e)):$(r=this.node()).getComputedStyle(r,null).getPropertyValue(t)}function W(t){return function(){delete this[t]}}function Z(t,n){return function(){this[t]=n}}function tt(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function nt(t,n){return arguments.length>1?this.each((null==n?W:"function"==typeof n?tt:Z)(t,n)):this.node()[t]}function et(t){return t.trim().split(/^|\s+/)}function rt(t){return t.classList||new it(t)}function it(t){this._node=t,this._names=et(t.getAttribute("class")||"")}function ot(t,n){for(var e=rt(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function ut(t,n){for(var e=rt(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function ct(t){return function(){ot(this,t)}}function st(t){return function(){ut(this,t)}}function at(t,n){return function(){(n.apply(this,arguments)?ot:ut)(this,t)}}function lt(t,n){var e=et(t+"");if(arguments.length<2){for(var r=rt(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?at:n?ct:st)(e,n))}function ft(){this.textContent=""}function ht(t){return function(){this.textContent=t}}function pt(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function _t(t){return arguments.length?this.each(null==t?ft:("function"==typeof t?pt:ht)(t)):this.node().textContent}function vt(){this.innerHTML=""}function dt(t){return function(){this.innerHTML=t}}function mt(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function yt(t){return arguments.length?this.each(null==t?vt:("function"==typeof t?mt:dt)(t)):this.node().innerHTML}function gt(){this.nextSibling&&this.parentNode.appendChild(this)}function wt(){return this.each(gt)}function At(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function xt(){return this.each(At)}function St(t){var n="function"==typeof t?t:i(t);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function bt(){return null}function Et(t,n){var e="function"==typeof t?t:i(t),r=null==n?bt:"function"==typeof n?n:m(n);return this.select(function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)})}function Nt(){var t=this.parentNode;t&&t.removeChild(this)}function Ct(){return this.each(Nt)}function Mt(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Lt(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 Pt(t,n){return function(){return Lt(this,t,n)}}function Tt(t,n){return function(){return Lt(this,t,n.apply(this,arguments))}}function qt(t,n){return this.each(("function"==typeof n?Tt:Pt)(t,n))}function Ot(t,n){this._groups=t,this._parents=n}function Bt(){return new Ot([[document.documentElement]],Jt)}function Dt(t){return"string"==typeof t?new Ot([[document.querySelector(t)]],[document.documentElement]):new Ot([[t]],Jt)}function Vt(t){return"string"==typeof t?new Ot([document.querySelectorAll(t)],[document.documentElement]):new Ot([t],Jt)}function Rt(t,n,e){arguments.length<3&&(e=n,n=_().changedTouches);for(var r,i=0,o=n?n.length:0;o>i;++i)if((r=n[i]).identifier===e)return v(t,r);return null}function jt(t,n){null==n&&(n=_().touches);for(var e=0,r=n?n.length:0,i=new Array(r);r>e;++e)i[e]=v(t,n[e]);return i}var zt="http://www.w3.org/1999/xhtml",Ht={svg:"http://www.w3.org/2000/svg",xhtml:zt,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},It=0;u.prototype=o.prototype={constructor:u,get:function(t){for(var n=this._;!(n in t);)if(!(t=t.parentNode))return;return t[n]},set:function(t,n){return t[this._]=n},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};var Ut=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var kt=document.documentElement;if(!kt.matches){var Gt=kt.webkitMatchesSelector||kt.msMatchesSelector||kt.mozMatchesSelector||kt.oMatchesSelector;Ut=function(t){return function(){return Gt.call(this,t)}}}}var Xt=Ut,Yt={};if(t.event=null,"undefined"!=typeof document){var $t=document.documentElement;"onmouseenter"in $t||(Yt={mouseenter:"mouseover",mouseleave:"mouseout"})}var Ft="$";N.prototype={constructor:N,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)}},it.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 Jt=[null];Ot.prototype=Bt.prototype={constructor:Ot,select:y,selectAll:w,filter:A,data:E,enter:M,exit:L,merge:P,order:T,sort:q,call:B,nodes:D,node:V,size:R,empty:j,each:z,attr:Y,style:Q,property:nt,classed:lt,text:_t,html:yt,raise:wt,lower:xt,append:St,insert:Et,remove:Ct,datum:Mt,on:h,dispatch:qt},t.creator=i,t.local=o,t.matcher=Xt,t.mouse=d,t.namespace=n,t.namespaces=Ht,t.select=Dt,t.selectAll=Vt,t.selection=Bt,t.selector=m,t.selectorAll=g,t.touch=Rt,t.touches=jt,t.window=$,t.customEvent=p,Object.defineProperty(t,"__esModule",{value:!0})});
// https://d3js.org/d3-selection/ Version 0.9.0. Copyright 2016 Mike Bostock.
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(t.d3=t.d3||{})}(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)),Ht.hasOwnProperty(n)?{space:Ht[n],local:t}:t}function e(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===zt&&n.documentElement.namespaceURI===zt?n.createElement(t):n.createElementNS(e,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 o(){return new u}function u(){this._="@"+(++It).toString(36)}function c(t,n,e){return t=s(t,n,e),function(n){var e=n.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||t.call(this,n)}}function s(n,e,r){return function(i){var o=t.event;t.event=i;try{n.call(this,this.__data__,e,r)}finally{t.event=o}}}function a(t){return t.trim().split(/^|\s+/).map(function(t){var n="",e=t.indexOf(".");return e>=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}})}function l(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;o>r;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++i]=e:this.removeEventListener(e.type,e.listener,e.capture);++i?n.length=i:delete this.__on}}}function f(t,n,e){var r=Yt.hasOwnProperty(t.type)?c:s;return function(i,o,u){var c,s=this.__on,a=r(n,o,u);if(s)for(var l=0,f=s.length;f>l;++l)if((c=s[l]).type===t.type&&c.name===t.name)return this.removeEventListener(c.type,c.listener,c.capture),this.addEventListener(c.type,c.listener=a,c.capture=e),void(c.value=n);this.addEventListener(t.type,a,e),c={type:t.type,name:t.name,value:n,listener:a,capture:e},s?s.push(c):this.__on=[c]}}function h(t,n,e){var r,i,o=a(t+""),u=o.length;{if(!(arguments.length<2)){for(c=n?f:l,null==e&&(e=!1),r=0;u>r;++r)this.each(c(o[r],n,e));return this}var c=this.node().__on;if(c)for(var s,h=0,p=c.length;p>h;++h)for(r=0,s=c[h];u>r;++r)if((i=o[r]).type===s.type&&i.name===s.name)return s.value}}function p(n,e,r,i){var o=t.event;n.sourceEvent=t.event,t.event=n;try{return e.apply(r,i)}finally{t.event=o}}function _(){for(var n,e=t.event;n=e.sourceEvent;)e=n;return e}function v(t,n){var e=t.ownerSVGElement||t;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=n.clientX,r.y=n.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}var i=t.getBoundingClientRect();return[n.clientX-i.left-t.clientLeft,n.clientY-i.top-t.clientTop]}function d(t){var n=_();return n.changedTouches&&(n=n.changedTouches[0]),v(t,n)}function m(t){return function(){return this.querySelector(t)}}function y(t){"function"!=typeof t&&(t=m(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;e>i;++i)for(var o,u,c=n[i],s=c.length,a=r[i]=new Array(s),l=0;s>l;++l)(o=c[l])&&(u=t.call(o,o.__data__,l,c))&&("__data__"in o&&(u.__data__=o.__data__),a[l]=u);return new Ot(r,this._parents)}function g(t){return function(){return this.querySelectorAll(t)}}function w(t){"function"!=typeof t&&(t=g(t));for(var n=this._groups,e=n.length,r=[],i=[],o=0;e>o;++o)for(var u,c=n[o],s=c.length,a=0;s>a;++a)(u=c[a])&&(r.push(t.call(u,u.__data__,a,c)),i.push(u));return new Ot(r,i)}function A(t){"function"!=typeof t&&(t=Xt(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;e>i;++i)for(var o,u=n[i],c=u.length,s=r[i]=[],a=0;c>a;++a)(o=u[a])&&t.call(o,o.__data__,a,u)&&s.push(o);return new Ot(r,this._parents)}function x(t){return function(){return t}}function S(t,n,e,r,i,o){for(var u,c=0,s=n.length,a=o.length;a>c;++c)(u=n[c])?(u.__data__=o[c],r[c]=u):e[c]=new N(t,o[c]);for(;s>c;++c)(u=n[c])&&(i[c]=u)}function b(t,n,e,r,i,o,u){var c,s,a,l={},f=n.length,h=o.length,p=new Array(f);for(c=0;f>c;++c)(s=n[c])&&(p[c]=a=Ft+u.call(s,s.__data__,c,n),a in l?i[c]=s:l[a]=s);for(c=0;h>c;++c)a=Ft+u.call(t,o[c],c,o),(s=l[a])?(r[c]=s,s.__data__=o[c],l[a]=null):e[c]=new N(t,o[c]);for(c=0;f>c;++c)(s=n[c])&&l[p[c]]===s&&(i[c]=s)}function E(t,n){if(!t)return p=new Array(this.size()),a=-1,this.each(function(t){p[++a]=t}),p;var e=n?b:S,r=this._parents,i=this._groups;"function"!=typeof t&&(t=x(t));for(var o=i.length,u=new Array(o),c=new Array(o),s=new Array(o),a=0;o>a;++a){var l=r[a],f=i[a],h=f.length,p=t.call(l,l&&l.__data__,a,r),_=p.length,v=c[a]=new Array(_),d=u[a]=new Array(_),m=s[a]=new Array(h);e(l,f,v,d,m,p,n);for(var y,g,w=0,A=0;_>w;++w)if(y=v[w]){for(w>=A&&(A=w+1);!(g=d[A])&&++A<_;);y._next=g||null}}return u=new Ot(u,r),u._enter=c,u._exit=s,u}function N(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 M(){return new Ot(this._enter||this._groups.map(C),this._parents)}function L(){return new Ot(this._exit||this._groups.map(C),this._parents)}function P(t){for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),u=new Array(r),c=0;o>c;++c)for(var s,a=n[c],l=e[c],f=a.length,h=u[c]=new Array(f),p=0;f>p;++p)(s=a[p]||l[p])&&(h[p]=s);for(;r>c;++c)u[c]=n[c];return new Ot(u,this._parents)}function T(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,i=t[n],o=i.length-1,u=i[o];--o>=0;)(r=i[o])&&(u&&u!==r.nextSibling&&u.parentNode.insertBefore(r,u),u=r);return this}function q(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=O);for(var e=this._groups,r=e.length,i=new Array(r),o=0;r>o;++o){for(var u,c=e[o],s=c.length,a=i[o]=new Array(s),l=0;s>l;++l)(u=c[l])&&(a[l]=u);a.sort(n)}return new Ot(i,this._parents).order()}function O(t,n){return n>t?-1:t>n?1:t>=n?0:NaN}function B(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function D(){var t=new Array(this.size()),n=-1;return this.each(function(){t[++n]=this}),t}function V(){for(var t=this._groups,n=0,e=t.length;e>n;++n)for(var r=t[n],i=0,o=r.length;o>i;++i){var u=r[i];if(u)return u}return null}function R(){var t=0;return this.each(function(){++t}),t}function j(){return!this.node()}function z(t){for(var n=this._groups,e=0,r=n.length;r>e;++e)for(var i,o=n[e],u=0,c=o.length;c>u;++u)(i=o[u])&&t.call(i,i.__data__,u,o);return this}function H(t){return function(){this.removeAttribute(t)}}function I(t){return function(){this.removeAttributeNS(t.space,t.local)}}function U(t,n){return function(){this.setAttribute(t,n)}}function k(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function G(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function X(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 Y(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?I:H:"function"==typeof e?r.local?X:G:r.local?k:U)(r,e))}function $(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function F(t){return function(){this.style.removeProperty(t)}}function J(t,n,e){return function(){this.style.setProperty(t,n,e)}}function K(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function Q(t,n,e){var r;return arguments.length>1?this.each((null==n?F:"function"==typeof n?K:J)(t,n,null==e?"":e)):$(r=this.node()).getComputedStyle(r,null).getPropertyValue(t)}function W(t){return function(){delete this[t]}}function Z(t,n){return function(){this[t]=n}}function tt(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function nt(t,n){return arguments.length>1?this.each((null==n?W:"function"==typeof n?tt:Z)(t,n)):this.node()[t]}function et(t){return t.trim().split(/^|\s+/)}function rt(t){return t.classList||new it(t)}function it(t){this._node=t,this._names=et(t.getAttribute("class")||"")}function ot(t,n){for(var e=rt(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function ut(t,n){for(var e=rt(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function ct(t){return function(){ot(this,t)}}function st(t){return function(){ut(this,t)}}function at(t,n){return function(){(n.apply(this,arguments)?ot:ut)(this,t)}}function lt(t,n){var e=et(t+"");if(arguments.length<2){for(var r=rt(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?at:n?ct:st)(e,n))}function ft(){this.textContent=""}function ht(t){return function(){this.textContent=t}}function pt(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}function _t(t){return arguments.length?this.each(null==t?ft:("function"==typeof t?pt:ht)(t)):this.node().textContent}function vt(){this.innerHTML=""}function dt(t){return function(){this.innerHTML=t}}function mt(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}function yt(t){return arguments.length?this.each(null==t?vt:("function"==typeof t?mt:dt)(t)):this.node().innerHTML}function gt(){this.nextSibling&&this.parentNode.appendChild(this)}function wt(){return this.each(gt)}function At(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function xt(){return this.each(At)}function St(t){var n="function"==typeof t?t:i(t);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function bt(){return null}function Et(t,n){var e="function"==typeof t?t:i(t),r=null==n?bt:"function"==typeof n?n:m(n);return this.select(function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)})}function Nt(){var t=this.parentNode;t&&t.removeChild(this)}function Ct(){return this.each(Nt)}function Mt(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Lt(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 Pt(t,n){return function(){return Lt(this,t,n)}}function Tt(t,n){return function(){return Lt(this,t,n.apply(this,arguments))}}function qt(t,n){return this.each(("function"==typeof n?Tt:Pt)(t,n))}function Ot(t,n){this._groups=t,this._parents=n}function Bt(){return new Ot([[document.documentElement]],Jt)}function Dt(t){return"string"==typeof t?new Ot([[document.querySelector(t)]],[document.documentElement]):new Ot([[t]],Jt)}function Vt(t){return"string"==typeof t?new Ot([document.querySelectorAll(t)],[document.documentElement]):new Ot([t],Jt)}function Rt(t,n,e){arguments.length<3&&(e=n,n=_().changedTouches);for(var r,i=0,o=n?n.length:0;o>i;++i)if((r=n[i]).identifier===e)return v(t,r);return null}function jt(t,n){null==n&&(n=_().touches);for(var e=0,r=n?n.length:0,i=new Array(r);r>e;++e)i[e]=v(t,n[e]);return i}var zt="http://www.w3.org/1999/xhtml",Ht={svg:"http://www.w3.org/2000/svg",xhtml:zt,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},It=0;u.prototype=o.prototype={constructor:u,get:function(t){for(var n=this._;!(n in t);)if(!(t=t.parentNode))return;return t[n]},set:function(t,n){return t[this._]=n},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};var Ut=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var kt=document.documentElement;if(!kt.matches){var Gt=kt.webkitMatchesSelector||kt.msMatchesSelector||kt.mozMatchesSelector||kt.oMatchesSelector;Ut=function(t){return function(){return Gt.call(this,t)}}}}var Xt=Ut,Yt={};if(t.event=null,"undefined"!=typeof document){var $t=document.documentElement;"onmouseenter"in $t||(Yt={mouseenter:"mouseover",mouseleave:"mouseout"})}var Ft="$";N.prototype={constructor:N,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)}},it.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 Jt=[null];Ot.prototype=Bt.prototype={constructor:Ot,select:y,selectAll:w,filter:A,data:E,enter:M,exit:L,merge:P,order:T,sort:q,call:B,nodes:D,node:V,size:R,empty:j,each:z,attr:Y,style:Q,property:nt,classed:lt,text:_t,html:yt,raise:wt,lower:xt,append:St,insert:Et,remove:Ct,datum:Mt,on:h,dispatch:qt},t.creator=i,t.local=o,t.matcher=Xt,t.mouse=d,t.namespace=n,t.namespaces=Ht,t.select=Dt,t.selectAll=Vt,t.selection=Bt,t.selector=m,t.selectorAll=g,t.touch=Rt,t.touches=jt,t.window=$,t.customEvent=p,Object.defineProperty(t,"__esModule",{value:!0})});
{
"name": "d3-selection",
"version": "0.8.0",
"version": "0.9.0",
"description": "Data-driven DOM manipulation: select elements and join them to data.",
"keywords": [
"d3",
"d3-module",
"dom",

@@ -27,3 +28,3 @@ "selection",

"prepublish": "npm run test && uglifyjs --preamble \"$(preamble)\" build/d3-selection.js -c -m -o build/d3-selection.min.js",
"postpublish": "VERSION=`node -e 'console.log(require(\"./package.json\").version)'`; git push && git push --tags && cp build/d3-selection.js ../d3.github.com/d3-selection.v0.8.js && cp build/d3-selection.min.js ../d3.github.com/d3-selection.v0.8.min.js && cd ../d3.github.com && git add d3-selection.v0.8.js d3-selection.v0.8.min.js && git commit -m \"d3-selection ${VERSION}\" && git push && cd - && zip -j build/d3-selection.zip -- LICENSE README.md build/d3-selection.js build/d3-selection.min.js"
"postpublish": "VERSION=`node -e 'console.log(require(\"./package.json\").version)'`; git push && git push --tags && cp build/d3-selection.js ../d3.github.com/d3-selection.v0.9.js && cp build/d3-selection.min.js ../d3.github.com/d3-selection.v0.9.min.js && cd ../d3.github.com && git add d3-selection.v0.9.js d3-selection.v0.9.min.js && git commit -m \"d3-selection ${VERSION}\" && git push && cd - && zip -j build/d3-selection.zip -- LICENSE README.md build/d3-selection.js build/d3-selection.min.js"
},

@@ -30,0 +31,0 @@ "devDependencies": {

@@ -39,6 +39,6 @@ # d3-selection

If you use NPM, `npm install d3-selection`. Otherwise, download the [latest release](https://github.com/d3/d3-selection/releases/latest). You can also load directly from [d3js.org](https://d3js.org), either as a [standalone library](https://d3js.org/d3-selection.v0.8.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-selection`. Otherwise, download the [latest release](https://github.com/d3/d3-selection/releases/latest). You can also load directly from [d3js.org](https://d3js.org), either as a [standalone library](https://d3js.org/d3-selection.v0.9.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-selection.v0.8.min.js"></script>
<script src="https://d3js.org/d3-selection.v0.9.min.js"></script>
<script>

@@ -123,3 +123,3 @@

If the *selector* is a function, it is evaluated for each selected element, in order, being passed the current datum `d` and index `i`, with the `this` context as the current DOM element. It must return an element, or null if there is no matching element. For example, to select the previous sibling of each paragraph:
If the *selector* is a function, it is evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element. It must return an element, or null if there is no matching element. For example, to select the previous sibling of each paragraph:

@@ -142,3 +142,3 @@ ```js

If the *selector* is a function, it is evaluated for each selected element, in order, being passed the current datum `d` and index `i`, with the `this` context as the current DOM element. It must return an array of elements (or a pseudo-array, such as a NodeList), or the empty array if there are no matching elements. For example, to select the previous and next siblings of each paragraph:
If the *selector* is a function, it is evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element. It must return an array of elements (or a pseudo-array, such as a NodeList), or the empty array if there are no matching elements. For example, to select the previous and next siblings of each paragraph:

@@ -158,3 +158,3 @@ ```js

Filters the selection, returning a new selection that contains only the elements for which the specified *filter* is true. The returned filtered selection preserves the index and parents of this selection, using null to represent missing (filtered-out) elements. The *filter* may be specified either as a selector string or a function. If a function, it is evaluated for each selected element, in order, being passed the current datum `d` and index `i`, with the `this` context as the current DOM element.
Filters the selection, returning a new selection that contains only the elements for which the specified *filter* is true. The *filter* may be specified either as a selector string or a function. If a function, it is evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element.

@@ -187,2 +187,4 @@ For example, to filter a selection of table rows to contain only even rows:

The returned filtered selection preserves the parents of this selection, but like [*array*.filter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter), it does not preserve indexes as some elements may be removed; use [*selection*.select](#selection_select) to preserve the index, if needed.
<a name="selection_merge" href="#selection_merge">#</a> <i>selection</i>.<b>merge</b>(<i>other</i>)

@@ -206,3 +208,3 @@

This method is also useful for merging [filtered](#selection_filter) selections because filtered selections retain the index structure of the originating selection. Note, however, that this method is not useful for concatenating arbitrary selections: if both this selection and the specified *other* selection have (non-null) elements at the same index, this selection’s element is returned in the merge and the *other* selection’s element is ignored.
This method is not intended for concatenating arbitrary selections, however: if both this selection and the specified *other* selection have (non-null) elements at the same index, this selection’s element is returned in the merge and the *other* selection’s element is ignored.

@@ -271,3 +273,3 @@ <a name="matcher" href="#matcher">#</a> d3.<b>matcher</b>(<i>selector</i>)

If a *value* is specified, sets the attribute with the specified *name* to the specified value on the selected elements and returns this selection. If the *value* is a constant, all elements are given the same attribute value; otherwise, if the *value* is a function, the function is evaluated for each selected element, in order, being passed the current datum *d* and index *i*, with the `this` context as the current DOM element. The function’s return value is then used to set each element’s attribute. A null value will remove the specified attribute.
If a *value* is specified, sets the attribute with the specified *name* to the specified value on the selected elements and returns this selection. If the *value* is a constant, all elements are given the same attribute value; otherwise, if the *value* is a function, the function is evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element. The function’s return value is then used to set each element’s attribute. A null value will remove the specified attribute.

@@ -286,3 +288,3 @@ If a *value* is not specified, returns the current value of the specified attribute for the first (non-null) element in the selection. This is generally useful only if you know that the selection contains exactly one element.

If the *value* is truthy, then all elements are assigned the specified classes; otherwise, the classes are unassigned. If the *value* is a function, then the function is evaluated for each selected element, in order, being passed the current datum *d* and index *i*, with the `this` context as the current DOM element. The function’s return value is then used to assign or unassign classes on each element. For example, to randomly associate the class *foo* with on average half the selected elements:
If the *value* is truthy, then all elements are assigned the specified classes; otherwise, the classes are unassigned. If the *value* is a function, then the function is evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element. The function’s return value is then used to assign or unassign classes on each element. For example, to randomly associate the class *foo* with on average half the selected elements:

@@ -297,3 +299,3 @@ ```js

If a *value* is specified, sets the style property with the specified *name* to the specified value on the selected elements and returns this selection. If the *value* is a constant, then all elements are given the same style property value; otherwise, if the *value* is a function, then the function is evaluated for each selected element, in order, being passed the current datum *d* and index *i*, with the `this` context as the current DOM element. The function’s return value is then used to set each element’s style property. A null value will remove the style property. An optional *priority* may also be specified, either as null or the string `important` (without the exclamation point).
If a *value* is specified, sets the style property with the specified *name* to the specified value on the selected elements and returns this selection. If the *value* is a constant, then all elements are given the same style property value; otherwise, if the *value* is a function, then the function is evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element. The function’s return value is then used to set each element’s style property. A null value will remove the style property. An optional *priority* may also be specified, either as null or the string `important` (without the exclamation point).

@@ -308,3 +310,3 @@ If a *value* is not specified, returns the current computed value of the specified style property for the first (non-null) element in the selection. This is generally useful only if you know the selection contains exactly one element. The computed value **may be different than the previously-set value**, particularly if it was set using a shorthand property (such as the `font` style, which is shorthand for `font-size`, `font-face`, etc.).

If a *value* is specified, sets the property with the specified *name* to the specified value on selected elements. If the *value* is a constant, then all elements are given the same property value; otherwise, if the *value* is a function, then the function is evaluated for each selected element, in order, being passed the current datum *d* and index *i*, with the `this` context as the current DOM element. The function’s return value is then used to set each element’s property. A null value will delete the specified property.
If a *value* is specified, sets the property with the specified *name* to the specified value on selected elements. If the *value* is a constant, then all elements are given the same property value; otherwise, if the *value* is a function, then the function is evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element. The function’s return value is then used to set each element’s property. A null value will delete the specified property.

@@ -315,3 +317,3 @@ If a *value* is not specified, returns the value of the specified property for the first (non-null) element in the selection. This is generally useful only if you know the selection contains exactly one element.

If a *value* is specified, sets the [text content](http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-textContent) to the specified value on all selected elements, replacing any existing child elements. If the *value* is a constant, then all elements are given the same text content; otherwise, if the *value* is a function, then the function is evaluated for each selected element, in order, being passed the current datum *d* and index *i*, with the `this` context as the current DOM element. The function’s return value is then used to set each element’s text content. A null value will clear the content.
If a *value* is specified, sets the [text content](http://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-textContent) to the specified value on all selected elements, replacing any existing child elements. If the *value* is a constant, then all elements are given the same text content; otherwise, if the *value* is a function, then the function is evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element. The function’s return value is then used to set each element’s text content. A null value will clear the content.

@@ -322,3 +324,3 @@ If a *value* is not specified, returns the text content for the first (non-null) element in the selection. This is generally useful only if you know the selection contains exactly one element.

If a *value* is specified, sets the [inner HTML](http://dev.w3.org/html5/spec-LC/apis-in-html-documents.html#innerhtml) to the specified value on all selected elements, replacing any existing child elements. If the *value* is a constant, then all elements are given the same inner HTML; otherwise, if the *value* is a function, then the function is evaluated for each selected element, in order, being passed the current datum *d* and index *i*, with the `this` context as the current DOM element. The function’s return value is then used to set each element’s inner HTML. A null value will clear the content.
If a *value* is specified, sets the [inner HTML](http://dev.w3.org/html5/spec-LC/apis-in-html-documents.html#innerhtml) to the specified value on all selected elements, replacing any existing child elements. If the *value* is a constant, then all elements are given the same inner HTML; otherwise, if the *value* is a function, then the function is evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element. The function’s return value is then used to set each element’s inner HTML. A null value will clear the content.

@@ -331,3 +333,3 @@ If a *value* is not specified, returns the inner HTML for the first (non-null) element in the selection. This is generally useful only if you know the selection contains exactly one element.

If the specified *type* is a string, appends a new element of this type (tag name) as the last child of each selected element, or the next following sibling in the update selection if this is an [enter selection](#selection_enter). (The enter behavior allows you to insert elements into the DOM in an order consistent with bound data; however, the slower [*selection*.order](#selection_order) may still be required if updating elements change order.) Otherwise, the *type* may be a function which is evaluated for each selected element, in order, being passed the current datum *d* and index *i*, with the `this` context as the current DOM element. This function should return an element to be appended. (The function typically creates a new element, but it may instead return an existing element.) For example, to append a DIV element to each paragraph:
If the specified *type* is a string, appends a new element of this type (tag name) as the last child of each selected element, or the next following sibling in the update selection if this is an [enter selection](#selection_enter). (The enter behavior allows you to insert elements into the DOM in an order consistent with bound data; however, the slower [*selection*.order](#selection_order) may still be required if updating elements change order.) Otherwise, the *type* may be a function which is evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element. This function should return an element to be appended. (The function typically creates a new element, but it may instead return an existing element.) For example, to append a DIV element to each paragraph:

@@ -360,3 +362,3 @@ ```js

If the specified *type* is a string, inserts a new element of this type (tag name) before the element matching the specified *before* selector for each selected element. For example, a *before* selector `:first-child` will prepend nodes before the first child. Both *type* and *before* may instead be specified as functions which are evaluated for each selected element, in order, being passed the current datum *d* and index *i*, with the `this` context as the current DOM element. The *type* function should return an element to be inserted; the *before* function should return the child element before which the element should be inserted. For example, to insert a DIV element to each paragraph:
If the specified *type* is a string, inserts a new element of this type (tag name) before the element matching the specified *before* selector for each selected element. For example, a *before* selector `:first-child` will prepend nodes before the first child. Both *type* and *before* may instead be specified as functions which are evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element. The *type* function should return an element to be inserted; the *before* function should return the child element before which the element should be inserted. For example, to insert a DIV element to each paragraph:

@@ -447,3 +449,3 @@ ```js

The *data* is specified **for each group** in the selection. If the selection has multiple groups (such as [d3.selectAll](#selectAll) followed by [*selection*.selectAll](#selection_selectAll)), then *data* should typically be specified as a function. This function will be invoked for each group in order, being passed the parent datum *d* (which may be undefined) and group index *i*, with the parent element as the `this` context. For example, to create an HTML table from a matrix of numbers:
The *data* is specified **for each group** in the selection. If the selection has multiple groups (such as [d3.selectAll](#selectAll) followed by [*selection*.selectAll](#selection_selectAll)), then *data* should typically be specified as a function. This function will be evaluated for each group in order, being passed the group’s parent datum (*d*, which may be undefined), the group index (*i*), and the selection’s parent nodes (*nodes*), with *this* as the group’s parent element. For example, to create an HTML table from a matrix of numbers:

@@ -471,3 +473,3 @@ ```js

If a *key* function is not specified, then the first datum in *data* is assigned to the first selected element, the second datum to the second selected element, and so on. A *key* function may be specified to control which datum is assigned to which element, replacing the default join-by-index. This key function is evaluated for each selected element, in order, being passed the current datum *d* and index *i*, with the `this` context as the current DOM element. The key function is then also evaluated for each new datum in *data*, being passed the datum `d` and index `i`, with the `this` context as the parent DOM element. The datum for a given key is assigned to the element with the matching key. If multiple elements have the same key, the duplicate elements are put into the exit selection; if multiple data have the same key, the duplicate data are put into the enter selection.
If a *key* function is not specified, then the first datum in *data* is assigned to the first selected element, the second datum to the second selected element, and so on. A *key* function may be specified to control which datum is assigned to which element, replacing the default join-by-index. This key function is evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element. The key function is then also evaluated for each new datum in *data*, being passed the current datum (*d*), the current index (*i*), and the group’s new *data*, with *this* as the group’s parent DOM element. The datum for a given key is assigned to the element with the matching key. If multiple elements have the same key, the duplicate elements are put into the exit selection; if multiple data have the same key, the duplicate data are put into the enter selection.

@@ -575,3 +577,3 @@ For example, given this document:

If a *value* is specified, sets the element’s bound data to the specified value on all selected elements. If the *value* is a constant, all elements are given the same datum; otherwise, if the *value* is a function, then the function is evaluated for each selected element, in order, being passed the previous datum `d` and the current index `i`, with the `this` context as the current DOM element. The function is then used to set each element’s data. A null value will delete the bound data.
If a *value* is specified, sets the element’s bound data to the specified value on all selected elements. If the *value* is a constant, all elements are given the same datum; otherwise, if the *value* is a function, then the function is evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element. The function is then used to set each element’s new data. A null value will delete the bound data.

@@ -603,3 +605,3 @@ If a *value* is not specified, returns the bound datum for the first (non-null) element in the selection. This is generally useful only if you know the selection contains exactly one element.

When a specified event is dispatched on a selected node, the specified *listener* will be invoked for each selected element, being passed the current datum `d` and index `i`, with the `this` context as the current DOM element. Listeners always see the latest datum for their element, but the index is a property of the selection and is fixed when the listener is assigned; to update the index, re-assign the listener. To access the current event within a listener, use [d3.event](#event).
When a specified event is dispatched on a selected node, the specified *listener* will be evaluated for each selected element, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element. Listeners always see the latest datum for their element, but the index is a property of the selection and is fixed when the listener is assigned; to update the index, re-assign the listener. To access the current event within a listener, use [d3.event](#event).

@@ -620,3 +622,3 @@ If an event listener was previously registered for the same *typename* on a selected element, the old listener is removed before the new listener is added. To remove a listener, pass null as the *listener*. To remove all listeners for a given name, pass null as the *listener* and `.foo` as the *typename*, where `foo` is the name; to remove all listeners with no name, specify `.` as the *typename*.

If *parameters* is a function, it is evaluated for each selected element, in order, being passed the current datum `d` and index `i`, with the `this` context as the current DOM element. It must return the parameters map for the current element.
If *parameters* is a function, it is evaluated for each selected element, in order, being passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* as the current DOM element. It must return the parameters map for the current element.

@@ -627,2 +629,4 @@ <a name="event" href="#event">#</a> d3.<b>event</b>

If you use Babel, Webpack, or another ES6-to-ES5 bundler, be aware that the value of d3.event changes during an event! An import of d3.event must be a [live binding](http://www.2ality.com/2015/07/es6-module-exports.html), so you may need to configure the bundler to import from D3’s ES6 modules rather than from the generated UMD bundle; not all bundlers observe [jsnext:main](https://github.com/rollup/rollup/wiki/jsnext:main). Also beware of conflicts with the [*window*.event](https://developer.mozilla.org/en-US/docs/Web/API/Window/event) global.
<a name="customEvent" href="#customEvent">#</a> d3.<b>customEvent</b>(<i>event</i>, <i>listener</i>[, <i>that</i>[, <i>arguments</i>]])

@@ -650,3 +654,3 @@

Invokes the specified *function* for each selected element, passing in the current datum `d` and index `i`, with the `this` context of the current DOM element. This method can be used to invoke arbitrary code for each selected element, and is useful for creating a context to access parent and child data simultaneously, such as:
Invokes the specified *function* for each selected element, passing in passed the current datum (*d*), the current index (*i*), and the current group (*nodes*), with *this* of the current DOM element. This method can be used to invoke arbitrary code for each selected element, and is useful for creating a context to access parent and child data simultaneously, such as:

@@ -653,0 +657,0 @@ ```js

@@ -8,5 +8,5 @@ import {Selection} from "./index";

for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {
for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, i = 0; i < n; ++i) {
for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {
if ((node = group[i]) && match.call(node, node.__data__, i, group)) {
subgroup[i] = node;
subgroup.push(node);
}

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