scinote-web/vendor/assets/javascripts/jsnetworkx.js

11 lines
242 KiB
JavaScript
Raw Normal View History

//* Licensed under the BSD license
//* Copyright (C) 2012 Felix Kling felix.kling@gmx.net
2016-02-12 23:52:43 +08:00
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,t.jsnx=e()}}(function(){return function e(t,r,n){function a(o,u){if(!r[o]){if(!t[o]){var s="function"==typeof require&&require;if(!u&&s)return s(o,!0);if(i)return i(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[o]={exports:{}};t[o][0].call(c.exports,function(e){var r=t[o][1][e];return a(r?r:e)},c,c.exports,e,t,r,n)}return r[o].exports}for(var i="function"==typeof require&&require,o=0;o<n.length;o++)a(n[o]);return a}({1:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r["default"]={workerPath:"jsnetworkx.js"},t.exports=r["default"]},{}],2:[function(e,t,r){"use strict";var n=e("babel-runtime/helpers/interop-require-default")["default"];Object.defineProperty(r,"__esModule",{value:!0});var a=e("lodash/collection/shuffle"),i=n(a),o=e("lodash/collection/sample"),u=n(o);r["default"]={shuffle:i["default"],sample:u["default"]},t.exports=r["default"]},{"babel-runtime/helpers/interop-require-default":107,"lodash/collection/sample":170,"lodash/collection/shuffle":171}],3:[function(e,t,r){"use strict";var n=e("babel-runtime/helpers/create-class")["default"],a=e("babel-runtime/helpers/class-call-check")["default"],i=e("babel-runtime/helpers/sliced-to-array")["default"],o=e("babel-runtime/core-js/object/create")["default"],u=e("babel-runtime/core-js/get-iterator")["default"],s=e("babel-runtime/regenerator")["default"],l=e("babel-runtime/core-js/symbol/iterator")["default"],c=e("babel-runtime/helpers/interop-require-default")["default"];Object.defineProperty(r,"__esModule",{value:!0});var f=e("./clear"),d=c(f),h=e("./isIterable"),p=c(h),v=e("lodash/lang/isFunction"),b=c(v),g=e("lodash/lang/isObject"),y=c(g),m=e("./isArrayLike"),w=c(m),x=e("lodash/collection/size"),k=c(x),j=function(){function e(t){if(a(this,e),this._stringValues=o(null),this._numberValues=o(null),this._values=o(null),this._keys=o(null),null!=t)if(p["default"](t)){var r=!0,n=!1,s=void 0;try{for(var l,c=u(t);!(r=(l=c.next()).done);r=!0){var f=i(l.value,2),d=f[0],h=f[1];this.set(d,h)}}catch(v){n=!0,s=v}finally{try{!r&&c["return"]&&c["return"]()}finally{if(n)throw s}}}else if(w["default"](t))for(var b=0;b<t.length;b++){var g=i(t[b],2),d=g[0],h=g[1];this.set(d,h)}else if(y["default"](t))for(var d in t)this.set(isNaN(+d)?d:+d,t[d])}return n(e,[{key:"_getStorage",value:function(e){switch(typeof e){case"number":return this._numberValues;case"string":return this._stringValues;default:return this._values}}},{key:"get",value:function(e,t){var r=this._getStorage(e);return e in r?r[e]:t}},{key:"has",value:function(e){return e in this._getStorage(e)}},{key:"set",value:function(e,t){var r=this._getStorage(e);return r[e]=t,r===this._values&&(this._keys[e]=e),this}},{key:"delete",value:function(e){var t=this._getStorage(e);return e in t?(delete t[e],t===this._values&&delete this._keys[e],!0):!1}},{key:"entries",value:s.mark(function t(){var e;return s.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=s.keys(this._numberValues);case 1:if((t.t1=t.t0()).done){t.next=7;break}return e=t.t1.value,t.next=5,[+e,this._numberValues[e]];case 5:t.next=1;break;case 7:t.t2=s.keys(this._stringValues);case 8:if((t.t3=t.t2()).done){t.next=14;break}return e=t.t3.value,t.next=12,[e,this._stringValues[e]];case 12:t.next=8;break;case 14:t.t4=s.keys(this._values);case 15:if((t.t5=t.t4()).done){t.next=21;break}return e=t.t5.value,t.next=19,[this._keys[e],this._values[e]];case 19:t.next=15;break;case 21:case"end":return t.stop()}},t,this)})},{key:"keys",value:s.mark(function r(){var e;return s.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=s.keys(this._numberValues);case 1:if((t.t1=t.t0()).done){t.next=7;break}return e=t.t1.value,t.next=5,+e;case 5:t.next=1;break;case 7:t.t2=s.keys(this._stringValues);case 8:if((t.t3=t.t2()).done){t.next=14;break}return e=
Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=n;var u=e("./isArrayLike"),s=o(u),l=e("./isIterator"),c=o(l),f=e("./isIterable"),d=o(f);t.exports=r["default"]},{"./isArrayLike":21,"./isIterable":24,"./isIterator":25,"babel-runtime/core-js/get-iterator":89,"babel-runtime/helpers/interop-require-default":107,"babel-runtime/regenerator":166}],40:[function(e,t,r){"use strict";function n(e,t){return c[0]=e,c[1]=t,c}function a(e,t,r){return f[0]=e,f[1]=t,f[2]=r,f}function i(e,t,r,n){return d[0]=e,d[1]=t,d[2]=r,d[3]=n,d}function o(e,t,r){return r.length=2,r[0]=e,r[1]=t,r}function u(e,t,r,n){return n.length=3,n[0]=e,n[1]=t,n[2]=r,n}function s(e,t,r,n,a){return a.length=4,a[0]=e,a[1]=t,a[2]=r,a[3]=n,a}function l(e){var t=new Array(e);switch(e){case 2:return function(e,r){return t[0]=e,t[1]=r,t};case 3:return function(e,r,n){return t[0]=e,t[1]=r,t[2]=n,t};default:throw new Error("Typle size not supported.")}}Object.defineProperty(r,"__esModule",{value:!0}),r.tuple2=n,r.tuple3=a,r.tuple4=i,r.tuple2c=o,r.tuple3c=u,r.tuple4c=s,r.createTupleFactory=l;var c=new Array(2),f=new Array(3),d=new Array(4)},{}],41:[function(e,t,r){"use strict";function n(){var e,t,r,n,o,u,s=arguments;return a.wrap(function(a){for(;;)switch(a.prev=a.next){case 0:e=s,t=e.length;case 2:r=!1,n=new Array(t),o=0;case 6:if(!(t>o)){a.next=15;break}if(u=e[o].next(),!u.done){a.next=11;break}return r=!0,a.abrupt("break",15);case 11:n[o]=u.value;case 12:o++,a.next=6;break;case 15:if(!r){a.next=17;break}return a.abrupt("break",21);case 17:return a.next=19,n;case 19:a.next=2;break;case 21:case"end":return a.stop()}},i[0],this)}var a=e("babel-runtime/regenerator")["default"];Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=n;var i=[n].map(a.mark);t.exports=r["default"]},{"babel-runtime/regenerator":166}],42:[function(e,t,r){"use strict";function n(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];var n,a,i=t.length,o=1/0,u=new Array(i);for(n=0;i>n;n++){var s=t[n],l=s.length;if(o>l&&(o=l,0===o))return[];u[n]=s[0]}for(a=new Array(o),a[0]=u,n=1;o>n;n++){u=new Array(i);for(var c=0;i>c;c++)u[c]=t[c][n];a[n]=u}return a}function a(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];var a=t[0];if(u["default"](a))return n.apply(null,t);if(l["default"](a))return f["default"].apply(null,t);throw new TypeError("Expected an iterator, array-like object or object, but got %s instead",a)}var i=e("babel-runtime/helpers/interop-require-default")["default"];Object.defineProperty(r,"__esModule",{value:!0}),r["default"]=a;var o=e("./isArrayLike"),u=i(o),s=e("./isIterator"),l=i(s),c=e("./zipIterator"),f=i(c);t.exports=r["default"]},{"./isArrayLike":21,"./isIterator":25,"./zipIterator":41,"babel-runtime/helpers/interop-require-default":107}],43:[function(e,t,r){"use strict";function n(e){var t=this,r=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=r.k,a=r.normalized,i=r.weight,o=r.endpoints;a=null==a?!0:a,o=null==o?!1:o;var f=new w.Map(v.mark(function g(){var r,n,a,i,o,u;return v.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:r=!0,n=!1,a=void 0,t.prev=3,i=b(e);case 5:if(r=(o=i.next()).done){t.next=12;break}return u=o.value,t.next=9,w.tuple2(u,0);case 9:r=!0,t.next=5;break;case 12:t.next=18;break;case 14:t.prev=14,t.t0=t["catch"](3),n=!0,a=t.t0;case 18:t.prev=18,t.prev=19,!r&&i["return"]&&i["return"]();case 21:if(t.prev=21,!n){t.next=24;break}throw a;case 24:return t.finish(21);case 25:return t.finish(18);case 26:case"end":return t.stop()}},g,t,[[3,14,18,26],[19,,21,25]])})()),h=e.nodes();return null!=n&&(h=w.Arrays.sample(h,n)),h.forEach(function(t){var r=null==i?u(e,t):s(e,t,i),n=p(r,3),a=n[0],d=n[1],h=n[2];f=o?c(f,a,d,h,t):l(f,a,d,h,t)}),d(f,e.order(),a,e.isDirected(),n)}function a(e,t){return m["default"]("betweennessCentrality",[e,t])}function i(e){var t=this,r=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=r.normalized,a=r.weight;n=null==n?!0:n;var i=new w.Map(v.mark(function G(){var r,n,a,i,o,u;return v.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:r=!0,n=!1,a=void 0,t.prev=3,i=b(e);cas
var r=e.degree(),n=p.triangles(e),a=h.numberOfCliques(e),i=[];r.forEach(function(e,t){i.push([r.get(t),n.get(t),a.get(t)])}),i.sort(function(e,t){return e[0]-t[0]||e[1]-t[1]||e[2]-t[2]});var o=t.degree(),u=p.triangles(t),s=h.numberOfCliques(t),l=[];return o.forEach(function(e,t){l.push([o.get(t),u.get(t),s.get(t)])}),l.sort(function(e,t){return e[0]-t[0]||e[1]-t[1]||e[2]-t[2]}),i.every(function(e,t){var r=l[t];return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]})}function a(e,t){return d["default"]("couldBeIsomorphic",[e,t])}function i(e,t){if(e.order()!==t.order())return!1;var r=e.degree(),n=p.triangles(e),a=[];r.forEach(function(e,t){a.push([r.get(t),n.get(t)])}),a.sort(function(e,t){return e[0]-t[0]||e[1]-t[1]});var i=t.degree(),o=p.triangles(t),u=[];return i.forEach(function(e,t){u.push([i.get(t),o.get(t)])}),u.sort(function(e,t){return e[0]-t[0]||e[1]-t[1]}),a.every(function(e,t){var r=u[t];return e[0]===r[0]&&e[1]===r[1]})}function o(e,t){return d["default"]("fastCouldBeIsomorphic",[e,t])}function u(e,t){if(e.order()!==t.order())return!1;var r=l(e.degree().values());r.sort(function(e,t){return e-t});var n=l(t.degree().values());return n.sort(function(e,t){return e-t}),r.every(function(e,t){return e===n[t]})}function s(e,t){return d["default"]("fasterCouldBeIsomorphic",[e,t])}var l=e("babel-runtime/core-js/array/from")["default"],c=e("babel-runtime/helpers/interop-require-default")["default"];Object.defineProperty(r,"__esModule",{value:!0}),r.couldBeIsomorphic=n,r.genCouldBeIsomorphic=a,r.fastCouldBeIsomorphic=i,r.genFastCouldBeIsomorphic=o,r.fasterCouldBeIsomorphic=u,r.genFasterCouldBeIsomorphic=s;var f=e("../../_internals/delegate"),d=c(f),h=e("../clique"),p=e("../cluster")},{"../../_internals/delegate":12,"../clique":46,"../cluster":47,"babel-runtime/core-js/array/from":88,"babel-runtime/helpers/interop-require-default":107}],53:[function(e,t,r){"use strict";function n(e,t){var r=new S["default"](t),n=new S["default"](e);if(r.size!==n.size||O.someIterator(n.values(),function(e){return!r.has(e)}))throw new k["default"]("Node sets of graphs are not equal.")}function a(e,t){function r(e,t){return t?j.relabelNodes(e,function(e){return t+e.toString()}):e}var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],a=n.rename,i=void 0===a?[null,null]:a;if(e.isMultigraph()!==t.isMultigraph())throw new k["default"]("G and H must both be graphs or multigraphs");var o=new e.constructor;if(o.name="union("+e.name+", "+t.name+")",e=r(e,i[0]),t=r(t,i[1]),new S["default"](e).intersection(new S["default"](t)).size>0)throw new k["default"]("The node sets of G and H are not disjoint. Use appropriate {rename: [Gprefix, Hprefix]} or use disjointUnion({G, H})");return o.addNodesFrom(e.nodesIter(!0)),o.addNodesFrom(t.nodesIter(!0)),o.addEdgesFrom(e.isMultigraph()?e.edgesIter(!0,!0):e.edgesIter(!0)),o.addEdgesFrom(t.isMultigraph()?t.edgesIter(!0,!0):t.edgesIter(!0)),b(o.graph,e.graph,t.graph),o}function i(e,t,r){return w["default"]("union",[e,t,r])}function o(e,t){var r=j.convertNodeLabelsToIntegers(e),n=j.convertNodeLabelsToIntegers(t,r.order()),i=a(r,n);return i.name="disjointUnion("+e.name+", "+t.name+")",b(i.graph,e.graph,t.graph),i}function u(e,t){return w["default"]("disjointUnion",[e,t])}function s(e,t){if(e.isMultigraph()!==t.isMultigraph())throw new k["default"]("G and H must both be graphs or multigraphs");var r=E.createEmptyCopy(e);r.name="Intersection of ("+e.name+" and "+t.name+")",n(e,t);var a=e.numberOfEdges()<t.numberOfEdges()?e:t,i=a===e?t:e,o=a.isMultigraph()?a.edgesIter(!1,!0):a.edgesIter(),u=i.hasEdge,s=r.addEdge,l=!0,c=!1,f=void 0;try{for(var d,h=g(o);!(l=(d=h.next()).done);l=!0){var p=d.value;u.apply(i,p)&&s.apply(r,p)}}catch(v){c=!0,f=v}finally{try{!l&&h["return"]&&h["return"]()}finally{if(c)throw f}}return r}function l(e,t){return w["default"]("intersection",[e,t])}function c(e,t){if(e.isMultigraph()!==t.isMultigraph())throw new k["default"]("G and H must both be graphs or multigraphs");var r=E.createEmptyCopy(e);e.name="Difference of ("+e.name+" and "+t.name+")",n(e,t);var a=e.isMultigraph()?e.edgesIter(!1,!0):e.
t.graph=k.deepcopy(this.graph),t.node=k.deepcopy(this.node),t}},{key:"reverse",value:function(){var e,t=arguments.length<=0||void 0===arguments[0]?!0:arguments[0];if(t)e=new this.constructor(null,{name:"Reverse of ("+this.name+")"}),e.addNodesFrom(this),e.addEdgesFrom(k.mapIterator(this.edgesIter(null,!0),function(e){return k.tuple3c(e[1],e[0],k.deepcopy(e[2]),e)})),e.graph=k.deepcopy(this.graph),e.node=k.deepcopy(this.node);else{var r=this.pred,n=this.succ;this.succ=r,this.pred=n,this.adj=this.succ,e=this}return e}},{key:"subgraph",value:function(e){var t,r=this.nbunchIter(e),n=new this.constructor,a=!0,i=!1,o=void 0;try{for(var s,l=f(r);!(a=(s=l.next()).done);a=!0)t=s.value,n.node.set(t,this.node.get(t))}catch(c){i=!0,o=c}finally{try{!a&&l["return"]&&l["return"]()}finally{if(i)throw o}}var d=n.succ,h=n.pred,p=!0,v=!1,b=void 0;try{for(var y,m=f(n);!(p=(y=m.next()).done);p=!0)t=y.value,d.set(t,new g["default"]),h.set(t,new g["default"])}catch(c){v=!0,b=c}finally{try{!p&&m["return"]&&m["return"]()}finally{if(v)throw b}}var w=!0,x=!1,k=void 0;try{for(var j,E=f(d);!(w=(j=E.next()).done);w=!0){var _=j.value,S=u(_,2),O=S[0],M=S[1],I=!0,P=!1,N=void 0;try{for(var A,$=f(this.succ.get(O));!(I=(A=$.next()).done);I=!0){var q=A.value,D=u(q,2),L=D[0],F=D[1];d.has(L)&&(M.set(L,F),h.get(L).set(O,F))}}catch(c){P=!0,N=c}finally{try{!I&&$["return"]&&$["return"]()}finally{if(P)throw N}}}}catch(c){x=!0,k=c}finally{try{!w&&E["return"]&&E["return"]()}finally{if(x)throw k}}return n.graph=this.graph,n}}],[{key:"__name__",get:function(){return"DiGraph"}}]),t}(v["default"]);r["default"]=j,t.exports=r["default"]},{"../_internals":20,"../_internals/Map":3,"../convert":69,"../exceptions/JSNetworkXError":73,"./Graph":61,"babel-runtime/core-js/array/from":88,"babel-runtime/core-js/get-iterator":89,"babel-runtime/core-js/object/assign":92,"babel-runtime/helpers/class-call-check":101,"babel-runtime/helpers/create-class":102,"babel-runtime/helpers/get":105,"babel-runtime/helpers/inherits":106,"babel-runtime/helpers/interop-require-default":107,"babel-runtime/helpers/interop-require-wildcard":108,"babel-runtime/helpers/sliced-to-array":109,"babel-runtime/regenerator":166}],61:[function(e,t,r){"use strict";var n=e("babel-runtime/helpers/create-class")["default"],a=e("babel-runtime/helpers/class-call-check")["default"],i=e("babel-runtime/helpers/sliced-to-array")["default"],o=e("babel-runtime/core-js/object/assign")["default"],u=e("babel-runtime/core-js/array/from")["default"],s=e("babel-runtime/core-js/get-iterator")["default"],l=e("babel-runtime/regenerator")["default"],c=e("babel-runtime/core-js/symbol/iterator")["default"],f=e("babel-runtime/helpers/interop-require-default")["default"],d=e("babel-runtime/helpers/interop-require-wildcard")["default"];Object.defineProperty(r,"__esModule",{value:!0});var h=e("../exceptions/KeyError"),p=f(h),v=e("../_internals/Map"),b=f(v),g=e("../_internals/Set"),y=f(g),m=e("../exceptions/JSNetworkXError"),w=f(m),x=e("lodash/lang/isBoolean"),k=f(x),j=e("lodash/lang/isString"),E=f(j),_=e("../convert"),S=d(_),O=e("../_internals"),M=function(){function t(e,r){return a(this,t),this instanceof t?(this.graph={},this.node=new b["default"],this.adj=new b["default"],null!=e&&S.toNetworkxGraph(e,this),r&&o(this.graph,r),void(this.edge=this.adj)):new t(e,r)}return n(t,[{key:"toString",value:function(){return this.name}},{key:"get",value:function(e){var t=this.adj.get(e);if("undefined"==typeof t)throw new p["default"]("Graph does not contain node "+e+".");return t}},{key:"addNode",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];if(!O.isPlainObject(t))throw new w["default"]("The attr_dict argument must be an object.");this.node.has(e)?o(this.node.get(e),t):(this.adj.set(e,new b["default"]),this.node.set(e,t))}},{key:"addNodesFrom",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];O.forEach(e,function(e){if(Array.isArray(e)&&2===e.length&&O.isPlainObject(e[1])){var r=i(e,2),n=r[0],a=r[1];if(this.adj.has(n)){var u=this.node.get(n);o(u,t,a)}else{this.adj.set(n,new b["def
}},{key:"degreeIter",value:d.mark(function v(e,t){var r,n,a,i,o,l,c,f,p,b,g,y;return d.wrap(function(d){for(var v=this;;)switch(d.prev=d.next){case 0:"string"==typeof e&&(t=e,e=null),r=null==e?this.adj:m.mapIterator(this.nbunchIter(e),function(e){return m.tuple2(e,v.adj.get(e))}),n=!0,a=!1,i=void 0,d.prev=5,o=h(r);case 7:if(n=(l=o.next()).done){d.next=25;break}if(c=u(l.value,2),f=c[0],p=c[1],b=0,null!=t){d.next=18;break}return p.forEach(function(e){return b+=s(e).length}),d.next=16,[f,b+ +(p.has(f)&&s(p.get(f)).length)];case 16:d.next=22;break;case 18:if(p.forEach(function(e){for(var r in e)b+=m.getDefault(e[r][t],1)}),p.has(f)){g=p.get(f);for(y in g)b+=m.getDefault(g[y][t],1)}return d.next=22,[f,b];case 22:n=!0,d.next=7;break;case 25:d.next=31;break;case 27:d.prev=27,d.t0=d["catch"](5),a=!0,i=d.t0;case 31:d.prev=31,d.prev=32,!n&&o["return"]&&o["return"]();case 34:if(d.prev=34,!a){d.next=37;break}throw i;case 37:return d.finish(34);case 38:return d.finish(31);case 39:case"end":return d.stop()}},v,this,[[5,27,31,39],[32,,34,38]])})},{key:"isMultigraph",value:function(){return!0}},{key:"isDirected",value:function(){return!1}},{key:"toDirected",value:function(){var t=new(e("./MultiDiGraph"));t.addNodesFrom(this);var r=!0,n=!1,a=void 0;try{for(var i,o=h(this.adjacencyIter());!(r=(i=o.next()).done);r=!0){var s=u(i.value,2),l=s[0],c=s[1],f=!0,d=!1,p=void 0;try{for(var v,b=h(c);!(f=(v=b.next()).done);f=!0){var g=u(v.value,2),y=g[0],w=g[1];for(var x in w)t.addEdge(l,y,x,m.deepcopy(w[x]))}}catch(k){d=!0,p=k}finally{try{!f&&b["return"]&&b["return"]()}finally{if(d)throw p}}}}catch(k){n=!0,a=k}finally{try{!r&&o["return"]&&o["return"]()}finally{if(n)throw a}}return t.graph=m.deepcopy(this.graph),t.node=m.deepcopy(this.node),t}},{key:"selfloopEdges",value:function(){var e=arguments.length<=0||void 0===arguments[0]?!1:arguments[0],t=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],r=[],n=!0,a=!1,i=void 0;try{for(var o,s=h(this.adj);!(n=(o=s.next()).done);n=!0){var l=u(o.value,2),c=l[0],f=l[1];if(f.has(c)){var d=f.get(c);for(var p in d){var v=[c,c];t&&(v[2]=p),e&&v.push(d[p]),r.push(v)}}}}catch(b){a=!0,i=b}finally{try{!n&&s["return"]&&s["return"]()}finally{if(a)throw i}}return r}},{key:"numberOfEdges",value:function(e,t){if(null==e||null==t)return this.size();var r=this.get(e);return r&&r.has(t)?s(r.get(t)).length:0}},{key:"subgraph",value:function(e){var t=this.nbunchIter(e),r=new this.constructor;this.node.forEach(function(e,t){return r.node.set(t,e)});var n=r.adj,a=this.adj,i=!0,o=!1,s=void 0;try{for(var l,c=h(t);!(i=(l=c.next()).done);i=!0){var f=l.value,d=new m.Map;n.set(f,d);var p=!0,v=!1,b=void 0;try{for(var g,y=h(a.get(f));!(p=(g=y.next()).done);p=!0){var w=u(g.value,2),x=w[0],k=w[1];if(n.has(x)){var j=m.clone(k);d.set(x,j),n.get(x).set(f,j)}}}catch(E){v=!0,b=E}finally{try{!p&&y["return"]&&y["return"]()}finally{if(v)throw b}}}}catch(E){o=!0,s=E}finally{try{!i&&c["return"]&&c["return"]()}finally{if(o)throw s}}return r.graph=this.graph,r}}],[{key:"__name__",get:function(){return"MultiGraph"}}]),r}(b["default"]);r["default"]=w,t.exports=r["default"]},{"../_internals":20,"../exceptions/JSNetworkXError":73,"./Graph":61,"./MultiDiGraph":62,"babel-runtime/core-js/array/from":88,"babel-runtime/core-js/get-iterator":89,"babel-runtime/core-js/object/assign":92,"babel-runtime/core-js/object/create":93,"babel-runtime/core-js/object/keys":97,"babel-runtime/helpers/class-call-check":101,"babel-runtime/helpers/create-class":102,"babel-runtime/helpers/get":105,"babel-runtime/helpers/inherits":106,"babel-runtime/helpers/interop-require-default":107,"babel-runtime/helpers/sliced-to-array":109,"babel-runtime/regenerator":166}],64:[function(e,t,r){"use strict";function n(e){return e.nodes()}function a(e){return e.nodesIter()}function i(e,t){return e.edges(t)}function o(e,t){return e.edgesIter(t)}function u(e,t,r){return e.degree(t,r)}function s(e,t){return e.neighbors(t)}function l(e){return e.numberOfNodes()}function c(e){return e.numberOfEdges()}function f(e){var t,r=e.numberOfNodes(),n=e.numberOfEdges();return t=0===n?0:e.isDirected()
try{for(var d,h=m(e.edgesIter(null,!0));!(l=(d=h.next()).done);l=!0){var p=y(d.value,3),u=(p[0],p[1],p[2]);delete u[O]}}catch(s){c=!0,f=s}finally{try{!l&&h["return"]&&h["return"]()}finally{if(c)throw f}}}var y=e("babel-runtime/helpers/sliced-to-array")["default"],m=e("babel-runtime/core-js/get-iterator")["default"],w=e("babel-runtime/core-js/array/from")["default"],x=e("babel-runtime/regenerator")["default"];Object.defineProperty(r,"__esModule",{value:!0}),r.draw=i;var k=e("../_internals"),j=function(){},E=null,_=null,S=["addNode","addNodesFrom","addEdge","addEdgesFrom","removeNode","removeNodesFrom","removeEdge","removeEdgesFrom","clear"],O="__d3datum__",M=t.d3,I={layoutAttr:{charge:-120,linkDistance:60},nodeShape:"circle",nodeAttr:{r:10},nodeStyle:{"stroke-width":2,stroke:"#333",fill:"#999",cursor:"pointer"},edgeAttr:{},edgeStyle:{fill:"#000","stroke-width":3},labelAttr:{},labelStyle:{"text-anchor":"middle","dominant-baseline":"central",cursor:"pointer","-webkit-user-select":"none",fill:"#000"},edgeLabelAttr:{},edgeLabelStyle:{"font-size":"0.8em","text-anchor":"middle","-webkit-user-select":"none"},edgeLabelOffset:{x:0,y:.5},withLabels:!1,withEdgeLabels:!1,edgeOffset:10,weighted:!1,weights:"weight",weightedStroke:!0,panZoom:{enabled:!0,scale:!0}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../_internals":20,"babel-runtime/core-js/array/from":88,"babel-runtime/core-js/get-iterator":89,"babel-runtime/helpers/sliced-to-array":109,"babel-runtime/regenerator":166}],72:[function(e,t,r){"use strict";var n=e("babel-runtime/helpers/get")["default"],a=e("babel-runtime/helpers/inherits")["default"],i=e("babel-runtime/helpers/class-call-check")["default"],o=e("babel-runtime/helpers/interop-require-default")["default"];Object.defineProperty(r,"__esModule",{value:!0});var u=e("./JSNetworkXException"),s=o(u),l=function(e){function t(e){i(this,t),n(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this.name="JSNetworkXAlgorithmError"}return a(t,e),t}(s["default"]);r["default"]=l,t.exports=r["default"]},{"./JSNetworkXException":74,"babel-runtime/helpers/class-call-check":101,"babel-runtime/helpers/get":105,"babel-runtime/helpers/inherits":106,"babel-runtime/helpers/interop-require-default":107}],73:[function(e,t,r){"use strict";var n=e("babel-runtime/helpers/get")["default"],a=e("babel-runtime/helpers/inherits")["default"],i=e("babel-runtime/helpers/class-call-check")["default"],o=e("babel-runtime/helpers/interop-require-default")["default"];Object.defineProperty(r,"__esModule",{value:!0});var u=e("./JSNetworkXException"),s=o(u),l=function(e){function t(e){i(this,t),n(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this.name="JSNetworkXError"}return a(t,e),t}(s["default"]);r["default"]=l,t.exports=r["default"]},{"./JSNetworkXException":74,"babel-runtime/helpers/class-call-check":101,"babel-runtime/helpers/get":105,"babel-runtime/helpers/inherits":106,"babel-runtime/helpers/interop-require-default":107}],74:[function(e,t,r){"use strict";var n=e("babel-runtime/helpers/class-call-check")["default"];Object.defineProperty(r,"__esModule",{value:!0});var a=function i(e){n(this,i),this.name="JSNetworkXException",this.message=e};r["default"]=a,t.exports=r["default"]},{"babel-runtime/helpers/class-call-check":101}],75:[function(e,t,r){"use strict";var n=e("babel-runtime/helpers/get")["default"],a=e("babel-runtime/helpers/inherits")["default"],i=e("babel-runtime/helpers/class-call-check")["default"],o=e("babel-runtime/helpers/interop-require-default")["default"];Object.defineProperty(r,"__esModule",{value:!0});var u=e("./JSNetworkXUnfeasible"),s=o(u),l=function(e){function t(e){i(this,t),n(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this.name="JSNetworkXNoPath"}return a(t,e),t}(s["default"]);r["default"]=l,t.exports=r["default"]},{"./JSNetworkXUnfeasible":76,"babel-runtime/helpers/class-call-check":101,"babel-runtime/helpers/get":105,"babel-runtime/helpers/inherits":106,"babel-runtime/helpers/interop-require-defa
}],112:[function(e,t,r){e("../modules/web.dom.iterable"),e("../modules/es6.string.iterator"),e("../modules/core.iter-helpers"),t.exports=e("../modules/$").core.isIterable},{"../modules/$":141,"../modules/core.iter-helpers":154,"../modules/es6.string.iterator":162,"../modules/web.dom.iterable":165}],113:[function(e,t,r){e("../modules/es6.object.to-string"),e("../modules/es6.string.iterator"),e("../modules/web.dom.iterable"),e("../modules/es6.map"),e("../modules/es7.map.to-json"),t.exports=e("../modules/$").core.Map},{"../modules/$":141,"../modules/es6.map":157,"../modules/es6.object.to-string":160,"../modules/es6.string.iterator":162,"../modules/es7.map.to-json":164,"../modules/web.dom.iterable":165}],114:[function(e,t,r){e("../../modules/es6.object.assign"),t.exports=e("../../modules/$").core.Object.assign},{"../../modules/$":141,"../../modules/es6.object.assign":158}],115:[function(e,t,r){var n=e("../../modules/$");t.exports=function(e,t){return n.create(e,t)}},{"../../modules/$":141}],116:[function(e,t,r){var n=e("../../modules/$");t.exports=function(e,t,r){return n.setDesc(e,t,r)}},{"../../modules/$":141}],117:[function(e,t,r){var n=e("../../modules/$");e("../../modules/es6.object.statics-accept-primitives"),t.exports=function(e,t){return n.getDesc(e,t)}},{"../../modules/$":141,"../../modules/es6.object.statics-accept-primitives":159}],118:[function(e,t,r){var n=e("../../modules/$");e("../../modules/es6.object.statics-accept-primitives"),t.exports=function(e){return n.getNames(e)}},{"../../modules/$":141,"../../modules/es6.object.statics-accept-primitives":159}],119:[function(e,t,r){e("../../modules/es6.object.statics-accept-primitives"),t.exports=e("../../modules/$").core.Object.keys},{"../../modules/$":141,"../../modules/es6.object.statics-accept-primitives":159}],120:[function(e,t,r){e("../modules/es6.object.to-string"),e("../modules/es6.string.iterator"),e("../modules/web.dom.iterable"),e("../modules/es6.promise"),t.exports=e("../modules/$").core.Promise},{"../modules/$":141,"../modules/es6.object.to-string":160,"../modules/es6.promise":161,"../modules/es6.string.iterator":162,"../modules/web.dom.iterable":165}],121:[function(e,t,r){e("../../modules/es6.symbol"),t.exports=e("../../modules/$").core.Symbol},{"../../modules/$":141,"../../modules/es6.symbol":163}],122:[function(e,t,r){e("../../modules/es6.string.iterator"),e("../../modules/web.dom.iterable"),t.exports=e("../../modules/$.wks")("iterator")},{"../../modules/$.wks":153,"../../modules/es6.string.iterator":162,"../../modules/web.dom.iterable":165}],123:[function(e,t,r){function n(e,t,r){if(!e)throw TypeError(r?t+r:t)}var a=e("./$");n.def=a.assertDefined,n.fn=function(e){if(!a.isFunction(e))throw TypeError(e+" is not a function!");return e},n.obj=function(e){if(!a.isObject(e))throw TypeError(e+" is not an object!");return e},n.inst=function(e,t,r){if(!(e instanceof t))throw TypeError(r+": use the 'new' operator!");return e},t.exports=n},{"./$":141}],124:[function(e,t,r){var n=e("./$"),a=e("./$.enum-keys");t.exports=Object.assign||function(e,t){for(var r=Object(n.assertDefined(e)),i=arguments.length,o=1;i>o;)for(var u,s=n.ES5Object(arguments[o++]),l=a(s),c=l.length,f=0;c>f;)r[u=l[f++]]=s[u];return r}},{"./$":141,"./$.enum-keys":132}],125:[function(e,t,r){function n(e){return o.call(e).slice(8,-1)}var a=e("./$"),i=e("./$.wks")("toStringTag"),o={}.toString;n.classof=function(e){var t,r;return void 0==e?void 0===e?"Undefined":"Null":"string"==typeof(r=(t=Object(e))[i])?r:n(t)},n.set=function(e,t,r){e&&!a.has(e=r?e:e.prototype,i)&&a.hide(e,i,t)},t.exports=n},{"./$":141,"./$.wks":153}],126:[function(e,t,r){"use strict";function n(e,t){if(!h(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!f(e,b)){if(!v(e))return"F";if(!t)return"E";p(e,b,++k)}return"O"+e[b]}function a(e,t){var r,a=n(t);if("F"!==a)return e[g][a];for(r=e[m];r;r=r.n)if(r.k==t)return r}var i=e("./$"),o=e("./$.ctx"),u=e("./$.uid").safe,s=e("./$.assert"),l=e("./$.for-of"),c=e("./$.iter").step,f=i.has,d=i.set,h=i.isObject,p=i.hide,v=Object.isExtensible||h,b=u("id"),g=u("O1"),y=u("last"),m
s.emit=o,s.binding=function(e){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(e){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},{}],169:[function(e,t,r){function n(e){var t=e?e.length:0;return t?e[t-1]:void 0}t.exports=n},{}],170:[function(e,t,r){function n(e,t,r){if(r?i(e,t,r):null==t){e=u(e);var n=e.length;return n>0?e[a(0,n-1)]:void 0}var l=-1,c=o(e),n=c.length,f=n-1;for(t=s(0>t?0:+t||0,n);++l<t;){var d=a(l,f),h=c[d];c[d]=c[l],c[l]=h}return c.length=t,c}var a=e("../internal/baseRandom"),i=e("../internal/isIterateeCall"),o=e("../lang/toArray"),u=e("../internal/toIterable"),s=Math.min;t.exports=n},{"../internal/baseRandom":194,"../internal/isIterateeCall":214,"../internal/toIterable":220,"../lang/toArray":233}],171:[function(e,t,r){function n(e){return a(e,i)}var a=e("./sample"),i=Number.POSITIVE_INFINITY;t.exports=n},{"./sample":170}],172:[function(e,t,r){function n(e){var t=e?a(e):0;return i(t)?t:o(e).length}var a=e("../internal/getLength"),i=e("../internal/isLength"),o=e("../object/keys");t.exports=n},{"../internal/getLength":206,"../internal/isLength":216,"../object/keys":235}],173:[function(e,t,r){function n(e,t){if("function"!=typeof e)throw new TypeError(a);return t=i(void 0===t?e.length-1:+t||0,0),function(){for(var r=arguments,n=-1,a=i(r.length-t,0),o=Array(a);++n<a;)o[n]=r[t+n];switch(t){case 0:return e.call(this,o);case 1:return e.call(this,r[0],o);case 2:return e.call(this,r[0],r[1],o)}var u=Array(t+1);for(n=-1;++n<t;)u[n]=r[n];return u[t]=o,e.apply(this,u)}}var a="Expected a function",i=Math.max;t.exports=n},{}],174:[function(e,t,r){function n(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}t.exports=n},{}],175:[function(e,t,r){function n(e,t){for(var r=-1,n=e.length;++r<n&&t(e[r],r,e)!==!1;);return e}t.exports=n},{}],176:[function(e,t,r){function n(e,t){for(var r=-1,n=e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}t.exports=n},{}],177:[function(e,t,r){function n(e,t){return null==t?e:a(t,i(t),e)}var a=e("./baseCopy"),i=e("../object/keys");t.exports=n},{"../object/keys":235,"./baseCopy":180}],178:[function(e,t,r){function n(e,t,r){var n=typeof e;return"function"==n?void 0===t?e:o(e,t,r):null==e?u:"object"==n?a(e):void 0===t?s(e):i(e,t)}var a=e("./baseMatches"),i=e("./baseMatchesProperty"),o=e("./bindCallback"),u=e("../utility/identity"),s=e("../utility/property");t.exports=n},{"../utility/identity":241,"../utility/property":242,"./baseMatches":188,"./baseMatchesProperty":189,"./bindCallback":198}],179:[function(e,t,r){function n(e,t,r,p,v,b,g){var m;if(r&&(m=v?r(e,p,v):r(e)),void 0!==m)return m;if(!d(e))return e;var w=f(e);if(w){if(m=s(e),!t)return a(e,m)}else{var k=G.call(e),j=k==y;if(k!=x&&k!=h&&(!j||v))return L[k]?l(e,k,t):v?e:{};if(m=c(j?{}:e),!t)return o(m,e)}b||(b=[]),g||(g=[]);for(var E=b.length;E--;)if(b[E]==e)return g[E];return b.push(e),g.push(m),(w?i:u)(e,function(a,i){m[i]=n(a,t,r,i,e,b,g)}),m}var a=e("./arrayCopy"),i=e("./arrayEach"),o=e("./baseAssign"),u=e("./baseForOwn"),s=e("./initCloneArray"),l=e("./initCloneByTag"),c=e("./initCloneObject"),f=e("../lang/isArray"),d=e("../lang/isObject"),h="[object Arguments]",p="[object Array]",v="[object Boolean]",b="[object Date]",g="[object Error]",y="[object Function]",m="[object Map]",w="[object Number]",x="[object Object]",k="[object RegExp]",j="[object Set]",E="[object String]",_="[object WeakMap]",S="[object ArrayBuffer]",O="[object Float32Array]",M="[object Float64Array]",I="[object Int8Array]",P="[object Int16Array]",N="[object Int32Array]",A="[object Uint8Array]",$="[object Uint8ClampedArray]",q="[object Uint16Array]",D="[object Uint32Array]",L={};L[h]=L[p]=L[S]=L[v]=L[b]=L[O]=L[M]=L[I]=L[P]=L[N]=L[w]=L[x]=L[k]=L[E]=L[A]=L[$]=L[q]=L[D]=!0,L[g]=L[y]=L[m]=L[j]=L[_]=!1;var F=Object.prototype,G=F.toString;t.exports=n},{"../lang/isArray":225,"../lang/isObject":229,"./arrayCopy":174,"./arrayEach":175,"./baseAssign":177,"./baseForOwn":183,"./initCloneArray":209,"./initCloneByTag":210,"./initCloneObject":211}],180:[function(e,t,r){function n(e,t