Socket
Socket
Sign inDemoInstall

d3-selection

Package Overview
Dependencies
Maintainers
2
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 2.0.0-rc.2 to 2.0.0-rc.3

7

dist/d3-selection.js

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

// https://d3js.org/d3-selection/ v2.0.0-rc.2 Copyright 2019 Mike Bostock
// https://d3js.org/d3-selection/ v2.0.0-rc.3 Copyright 2020 Mike Bostock
(function (global, factory) {

@@ -820,2 +820,6 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :

function selection_selection() {
return this;
}
Selection.prototype = selection.prototype = {

@@ -831,2 +835,3 @@ constructor: Selection,

merge: selection_merge,
selection: selection_selection,
order: selection_order,

@@ -833,0 +838,0 @@ sort: selection_sort,

4

dist/d3-selection.min.js

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

// https://d3js.org/d3-selection/ v2.0.0-rc.2 Copyright 2019 Mike Bostock
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t=t||self).d3=t.d3||{})}(this,function(t){"use strict";var n="http://www.w3.org/1999/xhtml",e={svg:"http://www.w3.org/2000/svg",xhtml:n,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function r(t){var n=t+="",r=n.indexOf(":");return r>=0&&"xmlns"!==(n=t.slice(0,r))&&(t=t.slice(r+1)),e.hasOwnProperty(n)?{space:e[n],local:t}:t}function i(t){var e=r(t);return(e.local?function(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}:function(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===n&&e.documentElement.namespaceURI===n?e.createElement(t):e.createElementNS(r,t)}})(e)}function o(){}function u(t){return null==t?o:function(){return this.querySelector(t)}}function s(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function c(){return[]}function a(t){return null==t?c:function(){return this.querySelectorAll(t)}}function l(t){return function(){return this.matches(t)}}function f(t){return new Array(t.length)}function h(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function p(t,n,e,r,i,o){for(var u,s=0,c=n.length,a=o.length;s<a;++s)(u=n[s])?(u.__data__=o[s],r[s]=u):e[s]=new h(t,o[s]);for(;s<c;++s)(u=n[s])&&(i[s]=u)}function _(t,n,e,r,i,o,u){var s,c,a,l=new Map,f=n.length,p=o.length,_=new Array(f);for(s=0;s<f;++s)(c=n[s])&&(_[s]=a=u.call(c,c.__data__,s,n)+"",l.has(a)?i[s]=c:l.set(a,c));for(s=0;s<p;++s)a=u.call(t,o[s],s,o)+"",(c=l.get(a))?(r[s]=c,c.__data__=o[s],l.delete(a)):e[s]=new h(t,o[s]);for(s=0;s<f;++s)(c=n[s])&&l.get(_[s])===c&&(i[s]=c)}function d(t){return t.__data__}function y(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function v(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function m(t,n){return t.style.getPropertyValue(n)||v(t).getComputedStyle(t,null).getPropertyValue(n)}function g(t){return t.trim().split(/^|\s+/)}function w(t){return t.classList||new A(t)}function A(t){this._node=t,this._names=g(t.getAttribute("class")||"")}function x(t,n){for(var e=w(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function S(t,n){for(var e=w(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function b(){this.textContent=""}function E(){this.innerHTML=""}function N(){this.nextSibling&&this.parentNode.appendChild(this)}function C(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function L(){return null}function P(){var t=this.parentNode;t&&t.removeChild(this)}function B(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function M(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function q(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r<o;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++i]=e:this.removeEventListener(e.type,e.listener,e.options);++i?n.length=i:delete this.__on}}}function T(t,n,e){return function(){var r,i=this.__on,o=function(t){return function(n){t.call(this,n,this.__data__)}}(n);if(i)for(var u=0,s=i.length;u<s;++u)if((r=i[u]).type===t.type&&r.name===t.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=o,r.options=e),void(r.value=n);this.addEventListener(t.type,o,e),r={type:t.type,name:t.name,value:n,listener:o,options:e},i?i.push(r):this.__on=[r]}}function D(t,n,e){var r=v(t),i=r.CustomEvent;"function"==typeof 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)}h.prototype={constructor:h,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)}},A.prototype={add:function(t){this._names.indexOf(t)<0&&(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 O=[null];function V(t,n){this._groups=t,this._parents=n}function j(){return new V([[document.documentElement]],O)}function R(t){return"string"==typeof t?new V([[document.querySelector(t)]],[document.documentElement]):new V([[t]],O)}V.prototype=j.prototype={constructor:V,select:function(t){"function"!=typeof t&&(t=u(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,s,c=n[i],a=c.length,l=r[i]=new Array(a),f=0;f<a;++f)(o=c[f])&&(s=t.call(o,o.__data__,f,c))&&("__data__"in o&&(s.__data__=o.__data__),l[f]=s);return new V(r,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){var n=t.apply(this,arguments);return null==n?[]:s(n)}}(t):a(t);for(var n=this._groups,e=n.length,r=[],i=[],o=0;o<e;++o)for(var u,c=n[o],l=c.length,f=0;f<l;++f)(u=c[f])&&(r.push(t.call(u,u.__data__,f,c)),i.push(u));return new V(r,i)},filter:function(t){"function"!=typeof t&&(t=l(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,u=n[i],s=u.length,c=r[i]=[],a=0;a<s;++a)(o=u[a])&&t.call(o,o.__data__,a,u)&&c.push(o);return new V(r,this._parents)},data:function(t,n){if(!arguments.length)return Array.from(this,d);var e,r=n?_:p,i=this._parents,o=this._groups;"function"!=typeof t&&(e=t,t=function(){return e});for(var u=o.length,c=new Array(u),a=new Array(u),l=new Array(u),f=0;f<u;++f){var h=i[f],y=o[f],v=y.length,m=s(t.call(h,h&&h.__data__,f,i)),g=m.length,w=a[f]=new Array(g),A=c[f]=new Array(g);r(h,y,w,A,l[f]=new Array(v),m,n);for(var x,S,b=0,E=0;b<g;++b)if(x=w[b]){for(b>=E&&(E=b+1);!(S=A[E])&&++E<g;);x._next=S||null}}return(c=new V(c,i))._enter=a,c._exit=l,c},enter:function(){return new V(this._enter||this._groups.map(f),this._parents)},exit:function(){return new V(this._exit||this._groups.map(f),this._parents)},join:function(t,n,e){var r=this.enter(),i=this,o=this.exit();return r="function"==typeof t?t(r):r.append(t+""),null!=n&&(i=n(i)),null==e?o.remove():e(o),r&&i?r.merge(i).order():i},merge:function(t){if(!(t instanceof V))throw new Error("invalid merge");for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),u=new Array(r),s=0;s<o;++s)for(var c,a=n[s],l=e[s],f=a.length,h=u[s]=new Array(f),p=0;p<f;++p)(c=a[p]||l[p])&&(h[p]=c);for(;s<r;++s)u[s]=n[s];return new V(u,this._parents)},order:function(){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&&4^r.compareDocumentPosition(u)&&u.parentNode.insertBefore(r,u),u=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=y);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var u,s=e[o],c=s.length,a=i[o]=new Array(c),l=0;l<c;++l)(u=s[l])&&(a[l]=u);a.sort(n)}return new V(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length;i<o;++i){var u=r[i];if(u)return u}return null},size:function(){let t=0;for(const n of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i,o=n[e],u=0,s=o.length;u<s;++u)(i=o[u])&&t.call(i,i.__data__,u,o);return this},attr:function(t,n){var e=r(t);if(arguments.length<2){var i=this.node();return e.local?i.getAttributeNS(e.space,e.local):i.getAttribute(e)}return this.each((null==n?e.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}}:"function"==typeof n?e.local?function(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,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}:e.local?function(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}:function(t,n){return function(){this.setAttribute(t,n)}})(e,n))},style:function(t,n,e){return arguments.length>1?this.each((null==n?function(t){return function(){this.style.removeProperty(t)}}:"function"==typeof n?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(t,n,e){return function(){this.style.setProperty(t,n,e)}})(t,n,null==e?"":e)):m(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?function(t){return function(){delete this[t]}}:"function"==typeof n?function(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}:function(t,n){return function(){this[t]=n}})(t,n)):this.node()[t]},classed:function(t,n){var e=g(t+"");if(arguments.length<2){for(var r=w(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?function(t,n){return function(){(n.apply(this,arguments)?x:S)(this,t)}}:n?function(t){return function(){x(this,t)}}:function(t){return function(){S(this,t)}})(e,n))},text:function(t){return arguments.length?this.each(null==t?b:("function"==typeof t?function(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}:function(t){return function(){this.textContent=t}})(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?E:("function"==typeof t?function(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}:function(t){return function(){this.innerHTML=t}})(t)):this.node().innerHTML},raise:function(){return this.each(N)},lower:function(){return this.each(C)},append:function(t){var n="function"==typeof t?t:i(t);return this.select(function(){return this.appendChild(n.apply(this,arguments))})},insert:function(t,n){var e="function"==typeof t?t:i(t),r=null==n?L:"function"==typeof n?n:u(n);return this.select(function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(P)},clone:function(t){return this.select(t?M:B)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,o=function(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}})}(t+""),u=o.length;if(!(arguments.length<2)){for(s=n?T:q,r=0;r<u;++r)this.each(s(o[r],n,e));return this}var s=this.node().__on;if(s)for(var c,a=0,l=s.length;a<l;++a)for(r=0,c=s[a];r<u;++r)if((i=o[r]).type===c.type&&i.name===c.name)return c.value},dispatch:function(t,n){return this.each(("function"==typeof n?function(t,n){return function(){return D(this,t,n.apply(this,arguments))}}:function(t,n){return function(){return D(this,t,n)}})(t,n))},[Symbol.iterator]:function*(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r,i=t[n],o=0,u=i.length;o<u;++o)(r=i[o])&&(yield r)}};var H=0;function I(){return new U}function U(){this._="@"+(++H).toString(36)}U.prototype=I.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._}},t.create=function(t){return R(i(t).call(document.documentElement))},t.creator=i,t.local=I,t.matcher=l,t.namespace=r,t.namespaces=e,t.pointer=function(t,n=t.currentTarget){if(n){var e=n.ownerSVGElement||n;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,[(r=r.matrixTransform(n.getScreenCTM().inverse())).x,r.y]}if(n.getBoundingClientRect){var i=n.getBoundingClientRect();return[t.clientX-i.left-n.clientLeft,t.clientY-i.top-n.clientTop]}}return[t.pageX,t.pageY]},t.select=R,t.selectAll=function(t){return"string"==typeof t?new V([document.querySelectorAll(t)],[document.documentElement]):new V([null==t?[]:s(t)],O)},t.selection=j,t.selector=u,t.selectorAll=a,t.style=m,t.window=v,Object.defineProperty(t,"__esModule",{value:!0})});
// https://d3js.org/d3-selection/ v2.0.0-rc.3 Copyright 2020 Mike Bostock
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t=t||self).d3=t.d3||{})}(this,function(t){"use strict";var n="http://www.w3.org/1999/xhtml",e={svg:"http://www.w3.org/2000/svg",xhtml:n,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function r(t){var n=t+="",r=n.indexOf(":");return r>=0&&"xmlns"!==(n=t.slice(0,r))&&(t=t.slice(r+1)),e.hasOwnProperty(n)?{space:e[n],local:t}:t}function i(t){var e=r(t);return(e.local?function(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}:function(t){return function(){var e=this.ownerDocument,r=this.namespaceURI;return r===n&&e.documentElement.namespaceURI===n?e.createElement(t):e.createElementNS(r,t)}})(e)}function o(){}function u(t){return null==t?o:function(){return this.querySelector(t)}}function s(t){return"object"==typeof t&&"length"in t?t:Array.from(t)}function c(){return[]}function a(t){return null==t?c:function(){return this.querySelectorAll(t)}}function l(t){return function(){return this.matches(t)}}function f(t){return new Array(t.length)}function h(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function p(t,n,e,r,i,o){for(var u,s=0,c=n.length,a=o.length;s<a;++s)(u=n[s])?(u.__data__=o[s],r[s]=u):e[s]=new h(t,o[s]);for(;s<c;++s)(u=n[s])&&(i[s]=u)}function _(t,n,e,r,i,o,u){var s,c,a,l=new Map,f=n.length,p=o.length,_=new Array(f);for(s=0;s<f;++s)(c=n[s])&&(_[s]=a=u.call(c,c.__data__,s,n)+"",l.has(a)?i[s]=c:l.set(a,c));for(s=0;s<p;++s)a=u.call(t,o[s],s,o)+"",(c=l.get(a))?(r[s]=c,c.__data__=o[s],l.delete(a)):e[s]=new h(t,o[s]);for(s=0;s<f;++s)(c=n[s])&&l.get(_[s])===c&&(i[s]=c)}function d(t){return t.__data__}function y(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function v(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function m(t,n){return t.style.getPropertyValue(n)||v(t).getComputedStyle(t,null).getPropertyValue(n)}function g(t){return t.trim().split(/^|\s+/)}function w(t){return t.classList||new A(t)}function A(t){this._node=t,this._names=g(t.getAttribute("class")||"")}function x(t,n){for(var e=w(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function S(t,n){for(var e=w(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function b(){this.textContent=""}function E(){this.innerHTML=""}function N(){this.nextSibling&&this.parentNode.appendChild(this)}function C(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function L(){return null}function P(){var t=this.parentNode;t&&t.removeChild(this)}function B(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function M(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function q(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,o=n.length;r<o;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++i]=e:this.removeEventListener(e.type,e.listener,e.options);++i?n.length=i:delete this.__on}}}function T(t,n,e){return function(){var r,i=this.__on,o=function(t){return function(n){t.call(this,n,this.__data__)}}(n);if(i)for(var u=0,s=i.length;u<s;++u)if((r=i[u]).type===t.type&&r.name===t.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=o,r.options=e),void(r.value=n);this.addEventListener(t.type,o,e),r={type:t.type,name:t.name,value:n,listener:o,options:e},i?i.push(r):this.__on=[r]}}function D(t,n,e){var r=v(t),i=r.CustomEvent;"function"==typeof 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)}h.prototype={constructor:h,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)}},A.prototype={add:function(t){this._names.indexOf(t)<0&&(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 O=[null];function V(t,n){this._groups=t,this._parents=n}function j(){return new V([[document.documentElement]],O)}function R(t){return"string"==typeof t?new V([[document.querySelector(t)]],[document.documentElement]):new V([[t]],O)}V.prototype=j.prototype={constructor:V,select:function(t){"function"!=typeof t&&(t=u(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,s,c=n[i],a=c.length,l=r[i]=new Array(a),f=0;f<a;++f)(o=c[f])&&(s=t.call(o,o.__data__,f,c))&&("__data__"in o&&(s.__data__=o.__data__),l[f]=s);return new V(r,this._parents)},selectAll:function(t){t="function"==typeof t?function(t){return function(){var n=t.apply(this,arguments);return null==n?[]:s(n)}}(t):a(t);for(var n=this._groups,e=n.length,r=[],i=[],o=0;o<e;++o)for(var u,c=n[o],l=c.length,f=0;f<l;++f)(u=c[f])&&(r.push(t.call(u,u.__data__,f,c)),i.push(u));return new V(r,i)},filter:function(t){"function"!=typeof t&&(t=l(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,u=n[i],s=u.length,c=r[i]=[],a=0;a<s;++a)(o=u[a])&&t.call(o,o.__data__,a,u)&&c.push(o);return new V(r,this._parents)},data:function(t,n){if(!arguments.length)return Array.from(this,d);var e,r=n?_:p,i=this._parents,o=this._groups;"function"!=typeof t&&(e=t,t=function(){return e});for(var u=o.length,c=new Array(u),a=new Array(u),l=new Array(u),f=0;f<u;++f){var h=i[f],y=o[f],v=y.length,m=s(t.call(h,h&&h.__data__,f,i)),g=m.length,w=a[f]=new Array(g),A=c[f]=new Array(g);r(h,y,w,A,l[f]=new Array(v),m,n);for(var x,S,b=0,E=0;b<g;++b)if(x=w[b]){for(b>=E&&(E=b+1);!(S=A[E])&&++E<g;);x._next=S||null}}return(c=new V(c,i))._enter=a,c._exit=l,c},enter:function(){return new V(this._enter||this._groups.map(f),this._parents)},exit:function(){return new V(this._exit||this._groups.map(f),this._parents)},join:function(t,n,e){var r=this.enter(),i=this,o=this.exit();return r="function"==typeof t?t(r):r.append(t+""),null!=n&&(i=n(i)),null==e?o.remove():e(o),r&&i?r.merge(i).order():i},merge:function(t){if(!(t instanceof V))throw new Error("invalid merge");for(var n=this._groups,e=t._groups,r=n.length,i=e.length,o=Math.min(r,i),u=new Array(r),s=0;s<o;++s)for(var c,a=n[s],l=e[s],f=a.length,h=u[s]=new Array(f),p=0;p<f;++p)(c=a[p]||l[p])&&(h[p]=c);for(;s<r;++s)u[s]=n[s];return new V(u,this._parents)},selection:function(){return this},order:function(){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&&4^r.compareDocumentPosition(u)&&u.parentNode.insertBefore(r,u),u=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=y);for(var e=this._groups,r=e.length,i=new Array(r),o=0;o<r;++o){for(var u,s=e[o],c=s.length,a=i[o]=new Array(c),l=0;l<c;++l)(u=s[l])&&(a[l]=u);a.sort(n)}return new V(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,o=r.length;i<o;++i){var u=r[i];if(u)return u}return null},size:function(){let t=0;for(const n of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i,o=n[e],u=0,s=o.length;u<s;++u)(i=o[u])&&t.call(i,i.__data__,u,o);return this},attr:function(t,n){var e=r(t);if(arguments.length<2){var i=this.node();return e.local?i.getAttributeNS(e.space,e.local):i.getAttribute(e)}return this.each((null==n?e.local?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}}:"function"==typeof n?e.local?function(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,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}:e.local?function(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}:function(t,n){return function(){this.setAttribute(t,n)}})(e,n))},style:function(t,n,e){return arguments.length>1?this.each((null==n?function(t){return function(){this.style.removeProperty(t)}}:"function"==typeof n?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(t,n,e){return function(){this.style.setProperty(t,n,e)}})(t,n,null==e?"":e)):m(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?function(t){return function(){delete this[t]}}:"function"==typeof n?function(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}:function(t,n){return function(){this[t]=n}})(t,n)):this.node()[t]},classed:function(t,n){var e=g(t+"");if(arguments.length<2){for(var r=w(this.node()),i=-1,o=e.length;++i<o;)if(!r.contains(e[i]))return!1;return!0}return this.each(("function"==typeof n?function(t,n){return function(){(n.apply(this,arguments)?x:S)(this,t)}}:n?function(t){return function(){x(this,t)}}:function(t){return function(){S(this,t)}})(e,n))},text:function(t){return arguments.length?this.each(null==t?b:("function"==typeof t?function(t){return function(){var n=t.apply(this,arguments);this.textContent=null==n?"":n}}:function(t){return function(){this.textContent=t}})(t)):this.node().textContent},html:function(t){return arguments.length?this.each(null==t?E:("function"==typeof t?function(t){return function(){var n=t.apply(this,arguments);this.innerHTML=null==n?"":n}}:function(t){return function(){this.innerHTML=t}})(t)):this.node().innerHTML},raise:function(){return this.each(N)},lower:function(){return this.each(C)},append:function(t){var n="function"==typeof t?t:i(t);return this.select(function(){return this.appendChild(n.apply(this,arguments))})},insert:function(t,n){var e="function"==typeof t?t:i(t),r=null==n?L:"function"==typeof n?n:u(n);return this.select(function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(P)},clone:function(t){return this.select(t?M:B)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,o=function(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}})}(t+""),u=o.length;if(!(arguments.length<2)){for(s=n?T:q,r=0;r<u;++r)this.each(s(o[r],n,e));return this}var s=this.node().__on;if(s)for(var c,a=0,l=s.length;a<l;++a)for(r=0,c=s[a];r<u;++r)if((i=o[r]).type===c.type&&i.name===c.name)return c.value},dispatch:function(t,n){return this.each(("function"==typeof n?function(t,n){return function(){return D(this,t,n.apply(this,arguments))}}:function(t,n){return function(){return D(this,t,n)}})(t,n))},[Symbol.iterator]:function*(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r,i=t[n],o=0,u=i.length;o<u;++o)(r=i[o])&&(yield r)}};var H=0;function I(){return new U}function U(){this._="@"+(++H).toString(36)}U.prototype=I.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._}},t.create=function(t){return R(i(t).call(document.documentElement))},t.creator=i,t.local=I,t.matcher=l,t.namespace=r,t.namespaces=e,t.pointer=function(t,n=t.currentTarget){if(n){var e=n.ownerSVGElement||n;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,[(r=r.matrixTransform(n.getScreenCTM().inverse())).x,r.y]}if(n.getBoundingClientRect){var i=n.getBoundingClientRect();return[t.clientX-i.left-n.clientLeft,t.clientY-i.top-n.clientTop]}}return[t.pageX,t.pageY]},t.select=R,t.selectAll=function(t){return"string"==typeof t?new V([document.querySelectorAll(t)],[document.documentElement]):new V([null==t?[]:s(t)],O)},t.selection=j,t.selector=u,t.selectorAll=a,t.style=m,t.window=v,Object.defineProperty(t,"__esModule",{value:!0})});
{
"name": "d3-selection",
"version": "2.0.0-rc.2",
"version": "2.0.0-rc.3",
"publishConfig": {

@@ -36,4 +36,6 @@ "tag": "next"

"test": "tape 'test/**/*-test.js' && eslint src",
"prepublishOnly": "rm -rf dist && yarn test"
"prepublishOnly": "rm -rf dist && yarn test",
"postpublish": "git push && git push --tags && cd ../d3.github.com && git pull && cp ../${npm_package_name}/dist/${npm_package_name}.js ${npm_package_name}.v${npm_package_version%%.*}.js && cp ../${npm_package_name}/dist/${npm_package_name}.min.js ${npm_package_name}.v${npm_package_version%%.*}.min.js && git add ${npm_package_name}.v${npm_package_version%%.*}.js ${npm_package_name}.v${npm_package_version%%.*}.min.js && git commit -m \"${npm_package_name} ${npm_package_version}\" && git push && cd - && zip -j dist/${npm_package_name}.zip -- LICENSE README.md dist/${npm_package_name}.js dist/${npm_package_name}.min.js"
},
"sideEffects": false,
"devDependencies": {

@@ -40,0 +42,0 @@ "eslint": "6",

@@ -52,2 +52,4 @@ # d3-selection

[Try d3-selection in your browser.](https://observablehq.com/collection/@d3/d3-selection)
## API Reference

@@ -202,2 +204,6 @@

<a name="selection_selection" href="#selection_selection">#</a> <i>selection</i>.<b>selection</b>() [<>](https://github.com/d3/d3-selection/blob/master/src/selection/index.js "Source")
Returns the selection (for symmetry with [<i>transition</i>.selection](https://github.com/d3/d3-transition/blob/master/README.md#transition_selection)).
<a name="matcher" href="#matcher">#</a> d3.<b>matcher</b>(<i>selector</i>) [<>](https://github.com/d3/d3-selection/blob/master/src/matcher.js "Source")

@@ -325,6 +331,6 @@

If the specified *type* 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 (*nodes*[*i*]). 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 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 (*nodes*[*i*]). 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 paragraph to each DIV element:
```js
d3.selectAll("p").append("div");
d3.selectAll("div").append("p");
```

@@ -335,3 +341,3 @@

```js
d3.selectAll("p").append(() => document.createElement("div"));
d3.selectAll("div").append(() => document.createElement("p"));
```

@@ -342,4 +348,4 @@

```js
d3.selectAll("p").select(function() {
return this.appendChild(document.createElement("div"));
d3.selectAll("div").select(function() {
return this.appendChild(document.createElement("p"));
});

@@ -356,6 +362,6 @@ ```

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 (*nodes*[*i*]). 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 append a DIV element to each paragraph:
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 (*nodes*[*i*]). 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 append a paragraph to each DIV element:
```js
d3.selectAll("p").insert("div");
d3.selectAll("div").insert("p");
```

@@ -366,3 +372,3 @@

```js
d3.selectAll("p").insert(() => document.createElement("div"));
d3.selectAll("div").insert(() => document.createElement("p"));
```

@@ -373,4 +379,4 @@

```js
d3.selectAll("p").select(function() {
return this.insertBefore(document.createElement("div"), null);
d3.selectAll("div").select(function() {
return this.insertBefore(document.createElement("p"), null);
});

@@ -522,3 +528,3 @@ ```

The *update* and *enter* selections are returned in data order, while the *exit* selection preserves the selection order prior to the join. If a key function is specified, the order of elements in the selection may not match their order in the document; use [*selection*.order](#order) or [*selection*.sort](#sort) as needed. For more on how the key function affects the join, see [A Bar Chart, Part 2](http://bost.ocks.org/mike/bar/2/) and [Object Constancy](http://bost.ocks.org/mike/constancy/).
The *update* and *enter* selections are returned in data order, while the *exit* selection preserves the selection order prior to the join. If a key function is specified, the order of elements in the selection may not match their order in the document; use [*selection*.order](#selection_order) or [*selection*.sort](#selection_sort) as needed. For more on how the key function affects the join, see [A Bar Chart, Part 2](http://bost.ocks.org/mike/bar/2/) and [Object Constancy](http://bost.ocks.org/mike/constancy/).

@@ -525,0 +531,0 @@ If *data* is not specified, this method returns the array of data for the selected elements.

@@ -45,2 +45,6 @@ import selection_select from "./select.js";

function selection_selection() {
return this;
}
Selection.prototype = selection.prototype = {

@@ -56,2 +60,3 @@ constructor: Selection,

merge: selection_merge,
selection: selection_selection,
order: selection_order,

@@ -58,0 +63,0 @@ sort: selection_sort,

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