Skip to content

Instantly share code, notes, and snippets.

@curran
Last active June 28, 2018 10:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save curran/609d03a426c22285b678352582f4f0ce to your computer and use it in GitHub Desktop.
Save curran/609d03a426c22285b678352582f4f0ce to your computer and use it in GitHub Desktop.
[unlisted] Broken Rollup with D3-Selection - Circular Dependencies
license: gpl-3.0
.DS_Store
node_modules
npm-debug.log
d3.js

An exact copy of D3 Custom Bundle, except that it uses the latest version of Rollup (and other dependencies).

The following errors are output:

index.js → d3.js...
(!) Circular dependency: node_modules/d3-selection/src/selection/index.js -> node_modules/d3-selection/src/selection/select.js -> node_modules/d3-selection/src/selection/index.js
(!) Circular dependency: node_modules/d3-selection/src/selection/index.js -> node_modules/d3-selection/src/selection/selectAll.js -> node_modules/d3-selection/src/selection/index.js
(!) Circular dependency: node_modules/d3-selection/src/selection/index.js -> node_modules/d3-selection/src/selection/filter.js -> node_modules/d3-selection/src/selection/index.js
(!) Circular dependency: node_modules/d3-selection/src/selection/index.js -> node_modules/d3-selection/src/selection/data.js -> node_modules/d3-selection/src/selection/index.js
(!) Circular dependency: node_modules/d3-selection/src/selection/index.js -> node_modules/d3-selection/src/selection/data.js -> node_modules/d3-selection/src/selection/enter.js -> node_modules/d3-selection/src/selection/index.js
(!) Circular dependency: node_modules/d3-selection/src/selection/index.js -> node_modules/d3-selection/src/selection/exit.js -> node_modules/d3-selection/src/selection/index.js
(!) Circular dependency: node_modules/d3-selection/src/selection/index.js -> node_modules/d3-selection/src/selection/merge.js -> node_modules/d3-selection/src/selection/index.js
(!) Circular dependency: node_modules/d3-selection/src/selection/index.js -> node_modules/d3-selection/src/selection/sort.js -> node_modules/d3-selection/src/selection/index.js
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(t.d3={})}(this,function(o){"use strict";var r="http://www.w3.org/1999/xhtml",i={svg:"http://www.w3.org/2000/svg",xhtml:r,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function u(t){var n=t+="",e=n.indexOf(":");return 0<=e&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),i.hasOwnProperty(n)?{space:i[n],local:t}:t}function s(t){var n=u(t);return(n.local?function(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}:function(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===r&&t.documentElement.namespaceURI===r?t.createElement(e):t.createElementNS(n,e)}})(n)}function n(){}function f(t){return null==t?n:function(){return this.querySelector(t)}}function h(){return[]}var t=function(t){return function(){return this.matches(t)}};if("undefined"!=typeof document){var e=document.documentElement;if(!e.matches){var c=e.webkitMatchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.oMatchesSelector;t=function(t){return function(){return c.call(this,t)}}}}var l=t;function a(t){return new Array(t.length)}function _(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}_.prototype={constructor:_,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 d="$";function x(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 _(t,o[s]);for(;s<c;++s)(u=n[s])&&(i[s]=u)}function b(t,n,e,r,i,o,u){var s,c,a,l={},f=n.length,h=o.length,p=new Array(f);for(s=0;s<f;++s)(c=n[s])&&(p[s]=a=d+u.call(c,c.__data__,s,n),a in l?i[s]=c:l[a]=c);for(s=0;s<h;++s)(c=l[a=d+u.call(t,o[s],s,o)])?((r[s]=c).__data__=o[s],l[a]=null):e[s]=new _(t,o[s]);for(s=0;s<f;++s)(c=n[s])&&l[p[s]]===c&&(i[s]=c)}function p(t,n){return t<n?-1:n<t?1:n<=t?0:NaN}function v(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function y(t){return t.trim().split(/^|\s+/)}function m(t){return t.classList||new g(t)}function g(t){this._node=t,this._names=y(t.getAttribute("class")||"")}function w(t,n){for(var e=m(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function A(t,n){for(var e=m(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function S(){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 M(){return null}function L(){var t=this.parentNode;t&&t.removeChild(this)}function P(){return this.parentNode.insertBefore(this.cloneNode(!1),this.nextSibling)}function q(){return this.parentNode.insertBefore(this.cloneNode(!0),this.nextSibling)}g.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);0<=n&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return 0<=this._names.indexOf(t)}};var B={};(o.event=null,"undefined"!=typeof document)&&("onmouseenter"in document.documentElement||(B={mouseenter:"mouseover",mouseleave:"mouseout"}));function O(e,t,n){return e=D(e,t,n),function(t){var n=t.relatedTarget;n&&(n===this||8&n.compareDocumentPosition(this))||e.call(this,t)}}function D(e,r,i){return function(t){var n=o.event;o.event=t;try{e.call(this,this.__data__,r,i)}finally{o.event=n}}}function T(o){return function(){var t=this.__on;if(t){for(var n,e=0,r=-1,i=t.length;e<i;++e)n=t[e],o.type&&n.type!==o.type||n.name!==o.name?t[++r]=n:this.removeEventListener(n.type,n.listener,n.capture);++r?t.length=r:delete this.__on}}}function j(c,a,l){var f=B.hasOwnProperty(c.type)?O:D;return function(t,n,e){var r,i=this.__on,o=f(a,n,e);if(i)for(var u=0,s=i.length;u<s;++u)if((r=i[u]).type===c.type&&r.name===c.name)return this.removeEventListener(r.type,r.listener,r.capture),this.addEventListener(r.type,r.listener=o,r.capture=l),void(r.value=a);this.addEventListener(c.type,o,l),r={type:c.type,name:c.name,value:a,listener:o,capture:l},i?i.push(r):this.__on=[r]}}function z(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)}var H=[null];function I(t,n){this._groups=t,this._parents=n}I.prototype=function(){return new I([[document.documentElement]],H)}.prototype={constructor:I,select:function(t){"function"!=typeof t&&(t=f(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var o,u,s=n[i],c=s.length,a=r[i]=new Array(c),l=0;l<c;++l)(o=s[l])&&(u=t.call(o,o.__data__,l,s))&&("__data__"in o&&(u.__data__=o.__data__),a[l]=u);return new I(r,this._parents)},selectAll:function(t){var n;"function"!=typeof t&&(t=null==(n=t)?h:function(){return this.querySelectorAll(n)});for(var e=this._groups,r=e.length,i=[],o=[],u=0;u<r;++u)for(var s,c=e[u],a=c.length,l=0;l<a;++l)(s=c[l])&&(i.push(t.call(s,s.__data__,l,c)),o.push(s));return new I(i,o)},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 I(r,this._parents)},data:function(t,n){if(!t)return _=new Array(this.size()),l=-1,this.each(function(t){_[++l]=t}),_;var e,r=n?b:x,i=this._parents,o=this._groups;"function"!=typeof t&&(e=t,t=function(){return e});for(var u=o.length,s=new Array(u),c=new Array(u),a=new Array(u),l=0;l<u;++l){var f=i[l],h=o[l],p=h.length,_=t.call(f,f&&f.__data__,l,i),d=_.length,v=c[l]=new Array(d),y=s[l]=new Array(d);r(f,h,v,y,a[l]=new Array(p),_,n);for(var m,g,w=0,A=0;w<d;++w)if(m=v[w]){for(A<=w&&(A=w+1);!(g=y[A])&&++A<d;);m._next=g||null}}return(s=new I(s,i))._enter=c,s._exit=a,s},enter:function(){return new I(this._enter||this._groups.map(a),this._parents)},exit:function(){return new I(this._exit||this._groups.map(a),this._parents)},merge:function(t){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 I(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];0<=--o;)(r=i[o])&&(u&&u!==r.nextSibling&&u.parentNode.insertBefore(r,u),u=r);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=p);for(var n=this._groups,r=n.length,i=new Array(r),o=0;o<r;++o){for(var u,s=n[o],c=s.length,a=i[o]=new Array(c),l=0;l<c;++l)(u=s[l])&&(a[l]=u);a.sort(t)}return new I(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){var t=new Array(this.size()),n=-1;return this.each(function(){t[++n]=this}),t},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(){var t=0;return this.each(function(){++t}),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=u(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?function(t){return function(){this.removeAttributeNS(t.space,t.local)}}:function(t){return function(){this.removeAttribute(t)}}:"function"==typeof n?e.local?function(n,e){return function(){var t=e.apply(this,arguments);null==t?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,t)}}:function(n,e){return function(){var t=e.apply(this,arguments);null==t?this.removeAttribute(n):this.setAttribute(n,t)}}: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 1<arguments.length?this.each((null==n?function(t){return function(){this.style.removeProperty(t)}}:"function"==typeof n?function(n,e,r){return function(){var t=e.apply(this,arguments);null==t?this.style.removeProperty(n):this.style.setProperty(n,t,r)}}:function(t,n,e){return function(){this.style.setProperty(t,n,e)}})(t,n,null==e?"":e)):(r=this.node(),i=t,r.style.getPropertyValue(i)||v(r).getComputedStyle(r,null).getPropertyValue(i));var r,i},property:function(t,n){return 1<arguments.length?this.each((null==n?function(t){return function(){delete this[t]}}:"function"==typeof n?function(n,e){return function(){var t=e.apply(this,arguments);null==t?delete this[n]:this[n]=t}}:function(t,n){return function(){this[t]=n}})(t,n)):this.node()[t]},classed:function(t,n){var e=y(t+"");if(arguments.length<2){for(var r=m(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)?w:A)(this,t)}}:n?function(t){return function(){w(this,t)}}:function(t){return function(){A(this,t)}})(e,n))},text:function(t){return arguments.length?this.each(null==t?S:("function"==typeof t?function(n){return function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}}: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(n){return function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}}: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:s(t);return this.select(function(){return this.appendChild(n.apply(this,arguments))})},insert:function(t,n){var e="function"==typeof t?t:s(t),r=null==n?M:"function"==typeof n?n:f(n);return this.select(function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(L)},clone:function(t){return this.select(t?q:P)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,o=(t+"").trim().split(/^|\s+/).map(function(t){var n="",e=t.indexOf(".");return 0<=e&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}),u=o.length;if(!(arguments.length<2)){for(s=n?j:T,null==e&&(e=!1),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 z(this,t,n.apply(this,arguments))}}:function(t,n){return function(){return z(this,t,n)}})(t,n))}},o.select=function(t){return"string"==typeof t?new I([[document.querySelector(t)]],[document.documentElement]):new I([[t]],H)},o.selectAll=function(t){return"string"==typeof t?new I([document.querySelectorAll(t)],[document.documentElement]):new I([null==t?[]:t],H)},Object.defineProperty(o,"__esModule",{value:!0})});
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src="d3.min.js"></script>
<script>
d3.select("body").append("h1").text("Hello, world!");
</script>
export {
event,
select,
selectAll
} from "d3-selection";
{
"name": "d3-custom-example",
"version": "0.0.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@types/estree": {
"version": "0.0.39",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz",
"integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==",
"dev": true
},
"@types/node": {
"version": "10.5.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.5.0.tgz",
"integrity": "sha512-baXPuqA7EVcBUpA5so2K26DTzk7NCWBc9xrPMu9PbUMwgusJRm9zJBPhiDmJVEcnTQ3aOxUZeuFHpd9qMYDNRg==",
"dev": true
},
"builtin-modules": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-2.0.0.tgz",
"integrity": "sha512-3U5kUA5VPsRUA3nofm/BXX7GVHKfxz0hOBAPxXrIvHzlDRkQVqEn6yi8QJegxl4LzOHLdvb7XF5dVawa/VVYBg==",
"dev": true
},
"commander": {
"version": "2.15.1",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz",
"integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==",
"dev": true
},
"d3-selection": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-1.3.0.tgz",
"integrity": "sha512-qgpUOg9tl5CirdqESUAu0t9MU/t3O9klYfGfyKsXEmhyxyzLpzpeh08gaxBUTQw1uXIOkr/30Ut2YRjSSxlmHA==",
"dev": true
},
"is-module": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz",
"integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=",
"dev": true
},
"path-parse": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz",
"integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=",
"dev": true
},
"resolve": {
"version": "1.8.1",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz",
"integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==",
"dev": true,
"requires": {
"path-parse": "^1.0.5"
}
},
"rollup": {
"version": "0.62.0",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-0.62.0.tgz",
"integrity": "sha512-mZS0aIGfYzuJySJD78znu9/hCJsNfBzg4lDuZGMj0hFVcYHt2evNRHv8aqiu9/w6z6Qn8AQoVl4iyEjDmisGeA==",
"dev": true,
"requires": {
"@types/estree": "0.0.39",
"@types/node": "*"
}
},
"rollup-plugin-node-resolve": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-3.3.0.tgz",
"integrity": "sha512-9zHGr3oUJq6G+X0oRMYlzid9fXicBdiydhwGChdyeNRGPcN/majtegApRKHLR5drboUvEWU+QeUmGTyEZQs3WA==",
"dev": true,
"requires": {
"builtin-modules": "^2.0.0",
"is-module": "^1.0.0",
"resolve": "^1.1.6"
}
},
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"dev": true
},
"uglify-js": {
"version": "3.4.2",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.2.tgz",
"integrity": "sha512-/kVQDzwiE9Vy7Y63eMkMozF4jIt0C2+xHctF9YpqNWdE/NLOuMurshkpoYGUlAbeYhACPv0HJPIHJul0Ak4/uw==",
"dev": true,
"requires": {
"commander": "~2.15.0",
"source-map": "~0.6.1"
}
}
}
}
{
"name": "d3-custom-example",
"version": "0.0.1",
"scripts": {
"prepublish": "rollup -c && uglifyjs d3.js -c -m -o d3.min.js"
},
"devDependencies": {
"d3-selection": "1",
"rollup": "0.62",
"rollup-plugin-node-resolve": "3",
"uglify-js": "3"
}
}
import node from "rollup-plugin-node-resolve";
export default {
entry: "index.js",
format: "umd",
moduleName: "d3",
plugins: [node()],
dest: "d3.js"
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment