49 lines
1.2 MiB
JavaScript
49 lines
1.2 MiB
JavaScript
|
window.dash_cytoscape=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=131)}([function(t,e,n){var r;try{r={cloneDeep:n(271),constant:n(60),defaults:n(272),each:n(96),filter:n(99),find:n(273),flatten:n(126),forEach:n(97),forIn:n(278),has:n(110),isUndefined:n(111),last:n(279),map:n(112),mapValues:n(280),max:n(281),merge:n(283),min:n(289),minBy:n(290),now:n(291),pick:n(292),range:n(297),reduce:n(114),sortBy:n(300),uniqueId:n(305),values:n(119),zipObject:n(306)}}catch(t){}r||(r=window._),t.exports=r},function(t,e){var n=Array.isArray;t.exports=n},function(t,e,n){"use strict";var r=n(0),i=n(5).Graph;function o(t,e,n,i){var o;do{o=r.uniqueId(i)}while(t.hasNode(o));return n.dummy=e,t.setNode(o,n),o}function a(t){return r.max(r.map(t.nodes(),(function(e){var n=t.node(e).rank;if(!r.isUndefined(n))return n})))}t.exports={addDummyNode:o,simplify:function(t){var e=(new i).setGraph(t.graph());return r.forEach(t.nodes(),(function(n){e.setNode(n,t.node(n))})),r.forEach(t.edges(),(function(n){var r=e.edge(n.v,n.w)||{weight:0,minlen:1},i=t.edge(n);e.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})})),e},asNonCompoundGraph:function(t){var e=new i({multigraph:t.isMultigraph()}).setGraph(t.graph());return r.forEach(t.nodes(),(function(n){t.children(n).length||e.setNode(n,t.node(n))})),r.forEach(t.edges(),(function(n){e.setEdge(n,t.edge(n))})),e},successorWeights:function(t){var e=r.map(t.nodes(),(function(e){var n={};return r.forEach(t.outEdges(e),(function(e){n[e.w]=(n[e.w]||0)+t.edge(e).weight})),n}));return r.zipObject(t.nodes(),e)},predecessorWeights:function(t){var e=r.map(t.nodes(),(function(e){var n={};return r.forEach(t.inEdges(e),(function(e){n[e.v]=(n[e.v]||0)+t.edge(e).weight})),n}));return r.zipObject(t.nodes(),e)},intersectRect:function(t,e){var n,r,i=t.x,o=t.y,a=e.x-i,s=e.y-o,u=t.width/2,c=t.height/2;if(!a&&!s)throw new Error("Not possible to find intersection inside of the rectangle");Math.abs(s)*u>Math.abs(a)*c?(s<0&&(c=-c),n=c*a/s,r=c):(a<0&&(u=-u),n=u,r=u*s/a);return{x:i+n,y:o+r}},buildLayerMatrix:function(t){var e=r.map(r.range(a(t)+1),(function(){return[]}));return r.forEach(t.nodes(),(function(n){var i=t.node(n),o=i.rank;r.isUndefined(o)||(e[o][i.order]=n)})),e},normalizeRanks:function(t){var e=r.min(r.map(t.nodes(),(function(e){return t.node(e).rank})));r.forEach(t.nodes(),(function(n){var i=t.node(n);r.has(i,"rank")&&(i.rank-=e)}))},removeEmptyRanks:function(t){var e=r.min(r.map(t.nodes(),(function(e){return t.node(e).rank}))),n=[];r.forEach(t.nodes(),(function(r){var i=t.node(r).rank-e;n[i]||(n[i]=[]),n[i].push(r)}));var i=0,o=t.graph().nodeRankFactor;r.forEach(n,(function(e,n){r.isUndefined(e)&&n%o!=0?--i:i&&r.forEach(e,(function(e){t.node(e).rank+=i}))}))},addBorderNode:function(t,e,n,r){var i={width:0,height:0};arguments.length>=4&&(i.rank=n,i.order=r);return o(t,"border",i,e)},maxRank:a,partition:function(t,e){var n={lhs:[],rhs:[]};return r.forEach(t,(function(t){e(t)?n.lhs.push(t):n.rhs.push(t)})),n},time:function(t,e){var n=r.now();try{return e()}finally{console.log(t+" time: "+(r.now()-n)+"ms")}},notime:function(t,e){return e()}}},function(t,e,n){var r;try{r={clone:n(159),constant:n(60),each:n(96),filter:n(99),has:n(110),isArray:n(1
|
|||
|
/*!
|
|||
|
Embeddable Minimum Strictly-Compliant Promises/A+ 1.1.1 Thenable
|
|||
|
Copyright (c) 2013-2014 Ralf S. Engelschall (http://engelschall.com)
|
|||
|
Licensed under The MIT License (http://opensource.org/licenses/MIT)
|
|||
|
*/
|
|||
|
var Mn=function t(e){if(!(this instanceof t))return new t(e);this.id="Thenable/1.0.7",this.state=0,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},"function"==typeof e&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};Mn.prototype={fulfill:function(t){return Dn(this,1,"fulfillValue",t)},reject:function(t){return Dn(this,2,"rejectReason",t)},then:function(t,e){var n=new Mn;return this.onFulfilled.push(Gn(t,n,"fulfill")),this.onRejected.push(Gn(e,n,"reject")),Rn(this),n.proxy}};var Dn=function(t,e,n,r){return 0===t.state&&(t.state=e,t[n]=r,Rn(t)),t},Rn=function(t){1===t.state?Bn(t,"onFulfilled",t.fulfillValue):2===t.state&&Bn(t,"onRejected",t.rejectReason)},Bn=function(t,n,r){if(0!==t[n].length){var i=t[n];t[n]=[];var o=function(){for(var t=0;t<i.length;t++)i[t](r)};"function"==typeof e?e(o):setTimeout(o,0)}},Gn=function(t,e,n){return function(r){if("function"!=typeof t)e[n].call(e,r);else{var i;try{i=t(r)}catch(t){return void e.reject(t)}Hn(e,i)}}},Hn=function t(e,n){if(e!==n&&e.proxy!==n){var r;if("object"===a(n)&&null!==n||"function"==typeof n)try{r=n.then}catch(t){return void e.reject(t)}if("function"!=typeof r)e.fulfill(n);else{var i=!1;try{r.call(n,(function(r){i||(i=!0,r===n?e.reject(new TypeError("circular thenable chain")):t(e,r))}),(function(t){i||(i=!0,e.reject(t))}))}catch(t){i||e.reject(t)}}}else e.reject(new TypeError("cannot resolve promise with itself"))};Mn.all=function(t){return new Mn((function(e,n){for(var r=new Array(t.length),i=0,o=function(n,o){r[n]=o,++i===t.length&&e(r)},a=0;a<t.length;a++)!function(e){var r=t[e];null!=r&&null!=r.then?r.then((function(t){o(e,t)}),(function(t){n(t)})):o(e,r)}(a)}))},Mn.resolve=function(t){return new Mn((function(e,n){e(t)}))},Mn.reject=function(t){return new Mn((function(e,n){n(t)}))};var Fn="undefined"!=typeof Promise?Promise:Mn,zn=function(t,e,n){var r=A(t),i=!r,o=this._private=G({duration:1e3},e,n);if(o.target=t,o.style=o.style||o.css,o.started=!1,o.playing=!1,o.hooked=!1,o.applying=!1,o.progress=0,o.completes=[],o.frames=[],o.complete&&m(o.complete)&&o.completes.push(o.complete),i){var a=t.position();o.startPosition=o.startPosition||{x:a.x,y:a.y},o.startStyle=o.startStyle||t.cy().style().getAnimationStartStyle(t,o.style)}if(r){var s=t.pan();o.startPan={x:s.x,y:s.y},o.startZoom=t.zoom()}this.length=1,this[0]=this},Yn=zn.prototype;G(Yn,{instanceString:function(){return"animation"},hook:function(){var t=this._private;if(!t.hooked){var e=t.target._private.animation;(t.queue?e.queue:e.current).push(this),S(t.target)&&t.target.cy().addToAnimationPool(t.target),t.hooked=!0}return this},play:function(){var t=this._private;return 1===t.progress&&(t.progress=0),t.playing=!0,t.started=!1,t.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var t=this._private;return t.applying=!0,t.started=!1,t.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var t=this._private;return t.playing=!1,t.started=!1,this},stop:function(){var t=this._private;return t.playing=!1,t.started=!1,t.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(t){var e=this._private;return void 0===t?e.progress*e.duration:this.progress(t/e.duration)},progress:function(t){var e=this._private,n=e.playing;return void 0===t?e.progress:(n&&this.pause(),e.progress=t,e.started=!1,n&&this.play(),this)},completed:function(){return 1===this._private.progress},reverse:function(){var t=this._private,e=t.playing;e&&this.pause(),t.progress=1-t.progress,t.started=!1;var n=function(e,n){var r=t[e];null!=r&&(t[e]=t[n],t[n]=r)};if(n("zoom","startZoom"),n("pan","startPan"),n("position","startPosition"),t.style)for(var r=0;r<t.style.length;r++){var i=t.style[r],o=i.name,a=t.startStyle[o];t.startStyle[o]=i,t.style[r]=a}return e&&this.play(),this},promise:function(t){var e,n=this._private;switch(t){case"frame":e=n.frames;break;default:case"complete":case"completed":e=n.completes}retu
|
|||
|
/*! Bezier curve function generator. Copyright Gaetan Renaudeau. MIT License: http://en.wikipedia.org/wiki/MIT_License */
|
|||
|
/*! Runge-Kutta spring physics function generator. Adapted from Framer.js, copyright Koen Bok. MIT License: http://en.wikipedia.org/wiki/MIT_License */
|
|||
|
var so=function(){function t(t){return-t.tension*t.x-t.friction*t.v}function e(e,n,r){var i={x:e.x+r.dx*n,v:e.v+r.dv*n,tension:e.tension,friction:e.friction};return{dx:i.v,dv:t(i)}}function n(n,r){var i={dx:n.v,dv:t(n)},o=e(n,.5*r,i),a=e(n,.5*r,o),s=e(n,r,a),u=1/6*(i.dx+2*(o.dx+a.dx)+s.dx),c=1/6*(i.dv+2*(o.dv+a.dv)+s.dv);return n.x=n.x+u*r,n.v=n.v+c*r,n}return function t(e,r,i){var o,a,s,u={x:-1,v:0,tension:null,friction:null},c=[0],l=0;for(e=parseFloat(e)||500,r=parseFloat(r)||20,i=i||null,u.tension=e,u.friction=r,a=(o=null!==i)?(l=t(e,r))/i*.016:.016;s=n(s||u,a),c.push(1+s.x),l+=16,Math.abs(s.x)>1e-4&&Math.abs(s.v)>1e-4;);return o?function(t){return c[t*(c.length-1)|0]}:l}}(),uo=function(t,e,n,r){var i=function(t,e,n,r){var i=4,o=.001,a=1e-7,s=10,u=11,c=1/(u-1),l="undefined"!=typeof Float32Array;if(4!==arguments.length)return!1;for(var f=0;f<4;++f)if("number"!=typeof arguments[f]||isNaN(arguments[f])||!isFinite(arguments[f]))return!1;t=Math.min(t,1),n=Math.min(n,1),t=Math.max(t,0),n=Math.max(n,0);var h=l?new Float32Array(u):new Array(u);function d(t,e){return 1-3*e+3*t}function p(t,e){return 3*e-6*t}function g(t){return 3*t}function v(t,e,n){return((d(e,n)*t+p(e,n))*t+g(e))*t}function b(t,e,n){return 3*d(e,n)*t*t+2*p(e,n)*t+g(e)}function y(e,r){for(var o=0;o<i;++o){var a=b(r,t,n);if(0===a)return r;r-=(v(r,t,n)-e)/a}return r}function w(){for(var e=0;e<u;++e)h[e]=v(e*c,t,n)}function m(e,r,i){var o,u,c=0;do{(o=v(u=r+(i-r)/2,t,n)-e)>0?i=u:r=u}while(Math.abs(o)>a&&++c<s);return u}function x(e){for(var r=0,i=1,a=u-1;i!==a&&h[i]<=e;++i)r+=c;--i;var s=r+(e-h[i])/(h[i+1]-h[i])*c,l=b(s,t,n);return l>=o?y(e,s):0===l?s:m(e,r,r+c)}var _=!1;function E(){_=!0,t===e&&n===r||w()}var k=function(i){return _||E(),t===e&&n===r?i:0===i?0:1===i?1:v(x(i),e,r)};k.getControlPoints=function(){return[{x:t,y:e},{x:n,y:r}]};var S="generateBezier("+[t,e,n,r]+")";return k.toString=function(){return S},k}(t,e,n,r);return function(t,e,n){return t+(e-t)*i(n)}},co={linear:function(t,e,n){return t+(e-t)*n},ease:uo(.25,.1,.25,1),"ease-in":uo(.42,0,1,1),"ease-out":uo(0,0,.58,1),"ease-in-out":uo(.42,0,.58,1),"ease-in-sine":uo(.47,0,.745,.715),"ease-out-sine":uo(.39,.575,.565,1),"ease-in-out-sine":uo(.445,.05,.55,.95),"ease-in-quad":uo(.55,.085,.68,.53),"ease-out-quad":uo(.25,.46,.45,.94),"ease-in-out-quad":uo(.455,.03,.515,.955),"ease-in-cubic":uo(.55,.055,.675,.19),"ease-out-cubic":uo(.215,.61,.355,1),"ease-in-out-cubic":uo(.645,.045,.355,1),"ease-in-quart":uo(.895,.03,.685,.22),"ease-out-quart":uo(.165,.84,.44,1),"ease-in-out-quart":uo(.77,0,.175,1),"ease-in-quint":uo(.755,.05,.855,.06),"ease-out-quint":uo(.23,1,.32,1),"ease-in-out-quint":uo(.86,0,.07,1),"ease-in-expo":uo(.95,.05,.795,.035),"ease-out-expo":uo(.19,1,.22,1),"ease-in-out-expo":uo(1,0,0,1),"ease-in-circ":uo(.6,.04,.98,.335),"ease-out-circ":uo(.075,.82,.165,1),"ease-in-out-circ":uo(.785,.135,.15,.86),spring:function(t,e,n){if(0===n)return co.linear;var r=so(t,e,n);return function(t,e,n){return t+(e-t)*r(n)}},"cubic-bezier":uo};function lo(t,e,n,r,i){if(1===r)return n;if(e===n)return n;var o=i(e,n,r);return null==t||((t.roundValue||t.color)&&(o=Math.round(o)),void 0!==t.min&&(o=Math.max(o,t.min)),void 0!==t.max&&(o=Math.min(o,t.max))),o}function fo(t,e){return null!=t.pfValue||null!=t.value?null==t.pfValue||null!=e&&"%"===e.type.units?t.value:t.pfValue:t}function ho(t,e,n,r,i){var o=null!=i?i.type:null;n<0?n=0:n>1&&(n=1);var a=fo(t,i),s=fo(e,i);if(E(a)&&E(s))return lo(o,a,s,n,r);if(x(a)&&x(s)){for(var u=[],c=0;c<s.length;c++){var l=a[c],f=s[c];if(null!=l&&null!=f){var h=lo(o,l,f,n,r);u.push(h)}else u.push(f)}return u}}function po(t,e,n,r){var i=!r,o=t._private,a=e._private,s=a.easing,u=a.startTime,c=(r?t:t.cy()).style();if(!a.easingImpl)if(null==s)a.easingImpl=co.linear;else{var l,f,h;if(w(s))l=c.parse("transition-timing-function",s).value;else l=s;w(l)?(f=l,h=[]):(f=l[1],h=l.slice(2).map((function(t){return+t}))),h.length>0?("spring"===f&&h.push(a.duration),a.easingImpl=co[f].apply(null,h)):a.easingImpl=co[f]}var d,p=a.easingImpl;if(d=0===a.duration?1:(n-u)/a.duration,a.applying&&(d=a.progress
|
|||
|
/**
|
|||
|
* @license
|
|||
|
* Lodash <https://lodash.com/>
|
|||
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|||
|
* Released under MIT license <https://lodash.com/license>
|
|||
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|||
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|||
|
*/(function(){var o="Expected a function",a="__lodash_placeholder__",s=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],u="[object Arguments]",c="[object Array]",l="[object Boolean]",f="[object Date]",h="[object Error]",d="[object Function]",p="[object GeneratorFunction]",g="[object Map]",v="[object Number]",b="[object Object]",y="[object RegExp]",w="[object Set]",m="[object String]",x="[object Symbol]",_="[object WeakMap]",E="[object ArrayBuffer]",k="[object DataView]",S="[object Float32Array]",C="[object Float64Array]",T="[object Int8Array]",A="[object Int16Array]",N="[object Int32Array]",O="[object Uint8Array]",L="[object Uint16Array]",P="[object Uint32Array]",I=/\b__p \+= '';/g,j=/\b(__p \+=) '' \+/g,M=/(__e\(.*?\)|\b__t\)) \+\n'';/g,D=/&(?:amp|lt|gt|quot|#39);/g,R=/[&<>"']/g,B=RegExp(D.source),G=RegExp(R.source),H=/<%-([\s\S]+?)%>/g,F=/<%([\s\S]+?)%>/g,z=/<%=([\s\S]+?)%>/g,Y=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,V=/^\w*$/,q=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,U=/[\\^$.*+?()[\]{}|]/g,X=RegExp(U.source),W=/^\s+|\s+$/g,$=/^\s+/,K=/\s+$/,Z=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Q=/\{\n\/\* \[wrapped with (.+)\] \*/,J=/,? & /,tt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,et=/\\(\\)?/g,nt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,rt=/\w*$/,it=/^[-+]0x[0-9a-f]+$/i,ot=/^0b[01]+$/i,at=/^\[object .+?Constructor\]$/,st=/^0o[0-7]+$/i,ut=/^(?:0|[1-9]\d*)$/,ct=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,lt=/($^)/,ft=/['\n\r\u2028\u2029\\]/g,ht="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",dt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",pt="[\\ud800-\\udfff]",gt="["+dt+"]",vt="["+ht+"]",bt="\\d+",yt="[\\u2700-\\u27bf]",wt="[a-z\\xdf-\\xf6\\xf8-\\xff]",mt="[^\\ud800-\\udfff"+dt+bt+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",xt="\\ud83c[\\udffb-\\udfff]",_t="[^\\ud800-\\udfff]",Et="(?:\\ud83c[\\udde6-\\uddff]){2}",kt="[\\ud800-\\udbff][\\udc00-\\udfff]",St="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Ct="(?:"+wt+"|"+mt+")",Tt="(?:"+St+"|"+mt+")",At="(?:"+vt+"|"+xt+")"+"?",Nt="[\\ufe0e\\ufe0f]?"+At+("(?:\\u200d(?:"+[_t,Et,kt].join("|")+")[\\ufe0e\\ufe0f]?"+At+")*"),Ot="(?:"+[yt,Et,kt].join("|")+")"+Nt,Lt="(?:"+[_t+vt+"?",vt,Et,kt,pt].join("|")+")",Pt=RegExp("['’]","g"),It=RegExp(vt,"g"),jt=RegExp(xt+"(?="+xt+")|"+Lt+Nt,"g"),Mt=RegExp([St+"?"+wt+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[gt,St,"$"].join("|")+")",Tt+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[gt,St+Ct,"$"].join("|")+")",St+"?"+Ct+"+(?:['’](?:d|ll|m|re|s|t|ve))?",St+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",bt,Ot].join("|"),"g"),Dt=RegExp("[\\u200d\\ud800-\\udfff"+ht+"\\ufe0e\\ufe0f]"),Rt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Bt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Gt=-1,Ht={};Ht[S]=Ht[C]=Ht[T]=Ht[A]=Ht[N]=Ht[O]=Ht["[object Uint8ClampedArray]"]=Ht[L]=Ht[P]=!0,Ht[u]=Ht[c]=Ht[E]=Ht[l]=Ht[k]=Ht[f]=Ht[h]=Ht[d]=Ht[g]=Ht[v]=Ht[b]=Ht[y]=Ht[w]=Ht[m]=Ht[_]=!1;var Ft={};Ft[u]=Ft[c]=Ft[E]=Ft[k]=Ft[l]=Ft[f]=Ft[S]=Ft[C]=Ft[T]=Ft[A]=Ft[N]=Ft[g]=Ft[v]=Ft[b]=Ft[y]=Ft[w]=Ft[m]=Ft[x]=Ft[O]=Ft["[object Uint8ClampedArray]"]=Ft[L]=Ft[P]=!0,Ft[h]=Ft[d]=Ft[_]=!1;var zt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Yt=parseFloat,Vt=parseInt,qt="object"==typeof t&&t&&t.Object===Object&&t,Ut="object"==typeof self&&self&&self.Object===Object&&self,Xt=qt||Ut||Function("return this")(),Wt=e&&!e.nodeType&&e,$t=Wt&
|
|||
|
/*!
|
|||
|
Copyright (C) 2010-2013 Raymond Hill: https://github.com/gorhill/Javascript-Voronoi
|
|||
|
MIT License: See https://github.com/gorhill/Javascript-Voronoi/LICENSE.md
|
|||
|
*/
|
|||
|
function n(){this.vertices=null,this.edges=null,this.cells=null,this.toRecycle=null,this.beachsectionJunkyard=[],this.circleEventJunkyard=[],this.vertexJunkyard=[],this.edgeJunkyard=[],this.cellJunkyard=[]}n.prototype.reset=function(){if(this.beachline||(this.beachline=new this.RBTree),this.beachline.root)for(var t=this.beachline.getFirst(this.beachline.root);t;)this.beachsectionJunkyard.push(t),t=t.rbNext;this.beachline.root=null,this.circleEvents||(this.circleEvents=new this.RBTree),this.circleEvents.root=this.firstCircleEvent=null,this.vertices=[],this.edges=[],this.cells=[]},n.prototype.sqrt=function(t){return Math.sqrt(t)},n.prototype.abs=function(t){return Math.abs(t)},n.prototype.ε=n.ε=1e-9,n.prototype.invε=n.invε=1/n.ε,n.prototype.equalWithEpsilon=function(t,e){return this.abs(t-e)<1e-9},n.prototype.greaterThanWithEpsilon=function(t,e){return t-e>1e-9},n.prototype.greaterThanOrEqualWithEpsilon=function(t,e){return e-t<1e-9},n.prototype.lessThanWithEpsilon=function(t,e){return e-t>1e-9},n.prototype.lessThanOrEqualWithEpsilon=function(t,e){return t-e<1e-9},n.prototype.RBTree=function(){this.root=null},n.prototype.RBTree.prototype.rbInsertSuccessor=function(t,e){var n,r,i;if(t){if(e.rbPrevious=t,e.rbNext=t.rbNext,t.rbNext&&(t.rbNext.rbPrevious=e),t.rbNext=e,t.rbRight){for(t=t.rbRight;t.rbLeft;)t=t.rbLeft;t.rbLeft=e}else t.rbRight=e;n=t}else this.root?(t=this.getFirst(this.root),e.rbPrevious=null,e.rbNext=t,t.rbPrevious=e,t.rbLeft=e,n=t):(e.rbPrevious=e.rbNext=null,this.root=e,n=null);for(e.rbLeft=e.rbRight=null,e.rbParent=n,e.rbRed=!0,t=e;n&&n.rbRed;)n===(r=n.rbParent).rbLeft?(i=r.rbRight)&&i.rbRed?(n.rbRed=i.rbRed=!1,r.rbRed=!0,t=r):(t===n.rbRight&&(this.rbRotateLeft(n),n=(t=n).rbParent),n.rbRed=!1,r.rbRed=!0,this.rbRotateRight(r)):(i=r.rbLeft)&&i.rbRed?(n.rbRed=i.rbRed=!1,r.rbRed=!0,t=r):(t===n.rbLeft&&(this.rbRotateRight(n),n=(t=n).rbParent),n.rbRed=!1,r.rbRed=!0,this.rbRotateLeft(r)),n=t.rbParent;this.root.rbRed=!1},n.prototype.RBTree.prototype.rbRemoveNode=function(t){t.rbNext&&(t.rbNext.rbPrevious=t.rbPrevious),t.rbPrevious&&(t.rbPrevious.rbNext=t.rbNext),t.rbNext=t.rbPrevious=null;var e,n,r=t.rbParent,i=t.rbLeft,o=t.rbRight;if(e=i?o?this.getFirst(o):i:o,r?r.rbLeft===t?r.rbLeft=e:r.rbRight=e:this.root=e,i&&o?(n=e.rbRed,e.rbRed=t.rbRed,e.rbLeft=i,i.rbParent=e,e!==o?(r=e.rbParent,e.rbParent=t.rbParent,t=e.rbRight,r.rbLeft=t,e.rbRight=o,o.rbParent=e):(e.rbParent=r,r=e,t=e.rbRight)):(n=t.rbRed,t=e),t&&(t.rbParent=r),!n)if(t&&t.rbRed)t.rbRed=!1;else{var a;do{if(t===this.root)break;if(t===r.rbLeft){if((a=r.rbRight).rbRed&&(a.rbRed=!1,r.rbRed=!0,this.rbRotateLeft(r),a=r.rbRight),a.rbLeft&&a.rbLeft.rbRed||a.rbRight&&a.rbRight.rbRed){a.rbRight&&a.rbRight.rbRed||(a.rbLeft.rbRed=!1,a.rbRed=!0,this.rbRotateRight(a),a=r.rbRight),a.rbRed=r.rbRed,r.rbRed=a.rbRight.rbRed=!1,this.rbRotateLeft(r),t=this.root;break}}else if((a=r.rbLeft).rbRed&&(a.rbRed=!1,r.rbRed=!0,this.rbRotateRight(r),a=r.rbLeft),a.rbLeft&&a.rbLeft.rbRed||a.rbRight&&a.rbRight.rbRed){a.rbLeft&&a.rbLeft.rbRed||(a.rbRight.rbRed=!1,a.rbRed=!0,this.rbRotateLeft(a),a=r.rbLeft),a.rbRed=r.rbRed,r.rbRed=a.rbLeft.rbRed=!1,this.rbRotateRight(r),t=this.root;break}a.rbRed=!0,t=r,r=r.rbParent}while(!t.rbRed);t&&(t.rbRed=!1)}},n.prototype.RBTree.prototype.rbRotateLeft=function(t){var e=t,n=t.rbRight,r=e.rbParent;r?r.rbLeft===e?r.rbLeft=n:r.rbRight=n:this.root=n,n.rbParent=r,e.rbParent=n,e.rbRight=n.rbLeft,e.rbRight&&(e.rbRight.rbParent=e),n.rbLeft=e},n.prototype.RBTree.prototype.rbRotateRight=function(t){var e=t,n=t.rbLeft,r=e.rbParent;r?r.rbLeft===e?r.rbLeft=n:r.rbRight=n:this.root=n,n.rbParent=r,e.rbParent=n,e.rbLeft=n.rbRight,e.rbLeft&&(e.rbLeft.rbParent=e),n.rbRight=e},n.prototype.RBTree.prototype.getFirst=function(t){for(;t.rbLeft;)t=t.rbLeft;return t},n.prototype.RBTree.prototype.getLast=function(t){for(;t.rbRight;)t=t.rbRight;return t},n.prototype.Diagram=function(t){this.site=t},n.prototype.Cell=function(t){this.site=t,this.halfedges=[],this.closeMe=!1},n.prototype.Cell.prototype.init=function(t){return this.site=t,this.halfedges=[],this.closeMe=!1,this},n.pro
|
|||
|
/*!
|
|||
|
Copyright © 2016 Max Franz
|
|||
|
|
|||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|||
|
this software and associated documentation files (the “Software”), to deal in
|
|||
|
the Software without restriction, including without limitation the rights to
|
|||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|||
|
of the Software, and to permit persons to whom the Software is furnished to do
|
|||
|
so, subject to the following conditions:
|
|||
|
|
|||
|
The above copyright notice and this permission notice shall be included in all
|
|||
|
copies or substantial portions of the Software.
|
|||
|
|
|||
|
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|||
|
SOFTWARE.
|
|||
|
*/
|
|||
|
f=function(){var define,module,exports;return function t(e,n,r){function i(a,s){if(!n[a]){if(!e[a]){if(!s&&"function"==typeof require&&require)return require(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var c=n[a]={exports:{}};e[a][0].call(c.exports,(function(t){var n=e[a][1][t];return i(n||t)}),c,c.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(t,e,n){"use strict";var r=t("./is"),i=t("./util"),o=t("./promise"),a=t("./event"),s={event:{regex:/(\w+)(\.\w+)?/,optionalTypeRegex:/(\w+)?(\.\w+)?/,falseCallback:function(){return!1}},on:function(t){return t=i.extend({},{unbindSelfOnTrigger:!1,unbindAllBindersOnTrigger:!1},t),function(e,n,i){var o=void 0!==this.length?this:[this],a=r.string(e),u=t;if((r.fn(n)||!1===n)&&(i=n,n=void 0),!r.fn(i)&&!1!==i&&a)return this;if(a){var c={};c[e]=i,e=c}for(var l in e)if(!1===(i=e[l])&&(i=s.event.falseCallback),r.fn(i)){l=l.split(/\s+/);for(var f=0;f<l.length;f++){var h=l[f];if(!r.emptyString(h)){var d=h.match(s.event.regex);if(d)for(var p={callback:i,data:n,type:d[1],namespace:d[2]?d[2]:void 0,unbindSelfOnTrigger:u.unbindSelfOnTrigger,unbindAllBindersOnTrigger:u.unbindAllBindersOnTrigger,binders:o},g=0;g<o.length;g++){var v=o[g]._private;v.listeners=v.listeners||[],v.listeners.push(p)}}}}return this}},eventAliasesOn:function(t){var e=t;e.addListener=e.listen=e.bind=e.on,e.removeListener=e.unlisten=e.unbind=e.off,e.emit=e.trigger,e.pon=e.promiseOn=function(t,e){var n=this,r=Array.prototype.slice.call(arguments,0);return new o((function(t,e){var i=r.concat([function(e){n.off.apply(n,o),t(e)}]),o=i.concat([]);n.on.apply(n,i)}))}},off:function(t){return t=i.extend({},{},t),function(t,e){var n=this,i=void 0!==n.length,o=i?n:[n],a=r.string(t);if(0===arguments.length){for(var u=0;u<o.length;u++)o[u]._private.listeners=[];return n}if(a){var c={};c[t]=e,t=c}for(var l in t){!1===(e=t[l])&&(e=s.event.falseCallback),l=l.split(/\s+/);for(var f=0;f<l.length;f++){var h=l[f];if(!r.emptyString(h)){var d=h.match(s.event.optionalTypeRegex);if(d){var p=d[1]?d[1]:void 0,g=d[2]?d[2]:void 0;for(u=0;u<o.length;u++)for(var v=o[u]._private.listeners=o[u]._private.listeners||[],b=0;b<v.length;b++){var y=v[b],w=!g||g===y.namespace,m=!p||y.type===p,x=!e||e===y.callback,_=w&&m&&x;_&&(v.splice(b,1),b--)}}}}}return n}},trigger:function(t){return t=i.extend({},{},t),function(t,e,n){var i=void 0!==this.length?this:[this],o=r.string(t),u=r.plainObject(t),c=r.event(t);if(o){var l=t.split(/\s+/);t=[];for(var f=0;f<l.length;f++){var h=l[f];if(!r.emptyString(h)){var d=h.match(s.event.regex),p=d[1],g=d[2]?d[2]:void 0;t.push({type:p,namespace:g})}}}else u&&(t=[t]);for(e?r.array(e)||(e=[e]):e=[],f=0;f<t.length;f++)for(var v=t[f],b=0;b<i.length;b++){var y=i[b],w=y._private.listeners=y._private.listeners||[];h=c?v:new a(v,{namespace:v.namespace}),n&&(w=[{namespace:h.namespace,type:h.type,callback:n}]);for(var m=0;m<w.length;m++){var x=w[m],_=!x.namespace||x.namespace===h.namespace,E=x.type===h.type;if(_&&E){var k=[h];if(k=k.concat(e),x.data?h.data=x.data:h.data=void 0,(x.unbindSelfOnTrigger||x.unbindAllBindersOnTrigger)&&(w.splice(m,1),m--),x.unbindAllBindersOnTrigger)for(var S=x.binders,C=0;C<S.length;C++){var T=S[C];if(T&&T!==y)for(var A=T._private.listeners,N=0;N<A.length;N++)A[N]===x&&(A.splice(N,1),N--)}var O=y,L=x.callback.apply(O,k);(!1===L||h.isPropagationStopped())&&!1===L&&(h.stopPropagation(),h.preventDefault())}}}return this}}};e.exports=s},{"./event":2,"./is":5,"./promise":6,"./util":8}],2:[function(t,e,n){"use strict";var r=function(t,e){if(!(this instanceof r))return new r(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented?o:i):this.type=t,e&&(this.type=void 0!==e.type?e.type:this.type,this.namespace=e.namespace,this.layout=e.layout,this.data=e.data,this.message=e.message),this.timeStamp=t&&t.timeStamp||+new Date};function i(){return!1}function o(){return!0}r.prototype={instanceString:function(){return"event"},preventDefault:fun
|
|||
|
/*! Weaver licensed under MIT (https://tldrlegal.com/license/mit-license), copyright Max Franz */
|
|||
|
"use strict";var r=t("./is"),i=t("./util"),o=t("./thread"),a=t("./promise"),s=t("./define"),u=function(e){if(!(this instanceof u))return new u(e);if(this._private={pass:[]},r.number(e),"undefined"!=typeof navigator&&null!=navigator.hardwareConcurrency)e=navigator.hardwareConcurrency;else try{e=t("os").cpus().length}catch(t){e=4}for(var n=0;n<e;n++)this[n]=new o;this.length=e},c=u.prototype;i.extend(c,{instanceString:function(){return"fabric"},require:function(t,e){for(var n=0;n<this.length;n++)this[n].require(t,e);return this},random:function(){return this[Math.round((this.length-1)*Math.random())]},run:function(t){var e=this._private.pass.shift();return this.random().pass(e).run(t)},message:function(t){return this.random().message(t)},broadcast:function(t){for(var e=0;e<this.length;e++)this[e].message(t);return this},stop:function(){for(var t=0;t<this.length;t++)this[t].stop();return this},pass:function(t){var e=this._private.pass;if(!r.array(t))throw"Only arrays may be used with fabric.pass()";return e.push(t),this},spreadSize:function(){var t=Math.ceil(this._private.pass[0].length/this.length);return t=Math.max(1,t)},spread:function(t){for(var e=this._private,n=this.spreadSize(),r=e.pass.shift().concat([]),i=[],o=0;o<this.length;o++){var s=this[o],u=r.splice(0,n),c=s.pass(u).run(t);if(i.push(c),0===r.length)break}return a.all(i).then((function(t){for(var e=[],n=0,r=0;r<t.length;r++)for(var i=t[r],o=0;o<i.length;o++){var a=i[o];e[n++]=a}return e}))},map:function(t){return this.require(t,"_$_$_fabmap"),this.spread((function(t){var e=[],n=resolve;resolve=function(t){e.push(t)};for(var r=0;r<t.length;r++){var i=e.length,o=_$_$_fabmap(t[r]);i===e.length&&e.push(o)}return resolve=n,e}))},filter:function(t){var e=this._private.pass[0];return this.map(t).then((function(t){for(var n=[],r=0;r<e.length;r++){var i=e[r];t[r]&&n.push(i)}return n}))},sort:function(t){var e=this._private.pass[0].length,n=this.spreadSize();return t=t||function(t,e){return t<e?-1:t>e?1:0},this.require(t,"_$_$_cmp"),this.spread((function(t){var e=t.sort(_$_$_cmp);resolve(e)})).then((function(r){for(var i=function(n,i,o){i=Math.min(i,e),o=Math.min(o,e);for(var a=n,s=i,u=[],c=a;c<o;c++){var l=r[n],f=r[i];n<s&&(i>=o||t(l,f)<=0)?(u.push(l),n++):(u.push(f),i++)}for(c=0;c<u.length;c++)r[a+c]=u[c]},o=n;o<e;o*=2)for(var a=0;a<e;a+=2*o)i(a,a+o,a+2*o);return r}))}});var l=function(t){return t=t||{},function(e,n){var r=this._private.pass.shift();return this.random().pass(r)[t.threadFn](e,n)}};i.extend(c,{randomMap:l({threadFn:"map"}),reduce:l({threadFn:"reduce"}),reduceRight:l({threadFn:"reduceRight"})});var f=c;f.promise=f.run,f.terminate=f.halt=f.stop,f.include=f.require,i.extend(c,{on:s.on(),one:s.on({unbindSelfOnTrigger:!0}),off:s.off(),trigger:s.trigger()}),s.eventAliasesOn(c),e.exports=u},{"./define":1,"./is":5,"./promise":6,"./thread":7,"./util":8,os:void 0}],4:[function(t,e,n){"use strict";var r=t("./thread"),i=t("./fabric"),o=function(){};o.version="1.2.0",o.thread=o.Thread=o.worker=o.Worker=r,o.fabric=o.Fabric=i,e.exports=o},{"./fabric":3,"./thread":7}],5:[function(t,e,n){"use strict";var r=typeof{},i=function(t){return t&&t.instanceString&&o.fn(t.instanceString)?t.instanceString():null},o={defined:function(t){return null!=t},string:function(t){return null!=t&&"string"==typeof t},fn:function(t){return null!=t&&"function"==typeof t},array:function(t){return Array.isArray?Array.isArray(t):null!=t&&t instanceof Array},plainObject:function(t){return null!=t&&typeof t===r&&!o.array(t)&&t.constructor===Object},object:function(t){return null!=t&&typeof t===r},number:function(t){return null!=t&&"number"==typeof t&&!isNaN(t)},integer:function(t){return o.number(t)&&Math.floor(t)===t},bool:function(t){return null!=t&&"boolean"==typeof t},event:function(t){return"event"===i(t)},thread:function(t){return"thread"===i(t)},fabric:function(t){return"fabric"===i(t)},emptyString:function(t){return!t||!(!o.string(t)||""!==t&&!t.match(/^\s+$/))},nonemptyString:function(t){return!(!t||!o.string(t)||""===t||t.match(/^\s+$/))}};e.exports=o},{}],6:[function(t,e,n){"use strict"
|
|||
|
/*! Weaver licensed under MIT (https://tldrlegal.com/license/mit-license), copyright Max Franz */
|
|||
|
"use strict";var window=_dereq_("./window"),util=_dereq_("./util"),Promise=_dereq_("./promise"),Event=_dereq_("./event"),define=_dereq_("./define"),is=_dereq_("./is"),Thread=function(t){if(!(this instanceof Thread))return new Thread(t);var e=this._private={requires:[],files:[],queue:null,pass:[],disabled:!1};is.plainObject(t)&&null!=t.disabled&&(e.disabled=!!t.disabled)},thdfn=Thread.prototype,stringifyFieldVal=function(t){return is.fn(t)?t.toString():"JSON.parse('"+JSON.stringify(t)+"')"},fnAsRequire=function(t){var e,n;is.object(t)&&t.fn?(e=fnAs(t.fn,t.name),n=t.name,t=t.fn):is.fn(t)?(e=t.toString(),n=t.name):is.string(t)?e=t:is.object(t)&&(e=t.proto?"":t.name+" = {};",n=t.name,t=t.obj),e+="\n";var r=function(t,n){if(t.prototype){var r=!1;for(var i in t.prototype){r=!0;break}r&&(e+=fnAsRequire({name:n,obj:t,proto:!0},t))}};if(t.prototype&&null!=n)for(var i in t.prototype){var o="",a=t.prototype[i];(o+=(s=n+".prototype."+i)+" = "+stringifyFieldVal(a)+";\n")&&(e+=o),r(a,s)}if(!is.string(t))for(var i in t){var s,u="";if(t.hasOwnProperty(i))a=t[i],u+=(s=n+'["'+i+'"]')+" = "+stringifyFieldVal(a)+";\n";u&&(e+=u),r(a,s)}return e},isPathStr=function(t){return is.string(t)&&t.match(/\.js$/)};util.extend(thdfn,{instanceString:function(){return"thread"},require:function(t,e){var n=this._private.requires;if(isPathStr(t))return this._private.files.push(t),this;if(e)t=is.fn(t)?{name:e,fn:t}:{name:e,obj:t};else if(is.fn(t)){if(!t.name)throw'The function name could not be automatically determined. Use thread.require( someFunction, "someFunction" )';t={name:t.name,fn:t}}return n.push(t),this},pass:function(t){return this._private.pass.push(t),this},run:function(fn,pass){var self=this,_p=this._private;if(pass=pass||_p.pass.shift(),_p.stopped)throw"Attempted to run a stopped thread! Start a new thread or do not stop the existing thread and reuse it.";if(_p.running)return _p.queue=_p.queue.then((function(){return self.run(fn,pass)}));var useWW=null!=window&&!_p.disabled,useNode=!window&&void 0!==module&&!_p.disabled;self.trigger("run");var runP=new Promise((function(resolve,reject){_p.running=!0;var threadTechAlreadyExists=_p.ran,fnImplStr=is.string(fn)?fn:fn.toString(),fnStr="\n"+_p.requires.map((function(t){return fnAsRequire(t)})).concat(_p.files.map((function(t){if(useWW)return'importScripts("'+((e=t).match(/^\.\//)||e.match(/^\.\./)?window.location.origin+window.location.pathname+e:e.match(/^\//)?window.location.origin+"/"+e:e)+'");';if(useNode)return'eval( require("fs").readFileSync("'+t+'", { encoding: "utf8" }) );';throw"External file `"+t+"` can not be required without any threading technology.";var e}))).concat(["( function(){","var ret = ("+fnImplStr+")("+JSON.stringify(pass)+");","if( ret !== undefined ){ resolve(ret); }","} )()\n"]).join("\n");if(_p.requires=[],_p.files=[],useWW){var fnBlob,fnUrl;if(!threadTechAlreadyExists){var fnPre=fnStr+"";fnStr=["function _ref_(o){ return eval(o); };","function broadcast(m){ return message(m); };","function message(m){ postMessage(m); };","function listen(fn){",' self.addEventListener("message", function(m){ ',' if( typeof m === "object" && (m.data.$$eval || m.data === "$$start") ){'," } else { "," fn( m.data );"," }"," });","};",'self.addEventListener("message", function(m){ if( m.data.$$eval ){ eval( m.data.$$eval ); } });',"function resolve(v){ postMessage({ $$resolve: v }); };","function reject(v){ postMessage({ $$reject: v }); };"].join("\n"),fnStr+=fnPre,fnBlob=new Blob([fnStr],{type:"application/javascript"}),fnUrl=window.URL.createObjectURL(fnBlob)}var ww=_p.webworker=_p.webworker||new Worker(fnUrl),cb;threadTechAlreadyExists&&ww.postMessage({$$eval:fnStr}),ww.addEventListener("message",cb=function(t){var e=is.object(t)&&is.object(t.data);e&&"$$resolve"in t.data?(ww.removeEventListener("message",cb),resolve(t.data.$$resolve)):e&&"$$reject"in t.data?(ww.removeEventListener("message",cb),reject(t.data.$$reject)):self.trigger(new Event(t,{type:"message",message:t.data}))},!1),threadTechAlreadyExists||ww.postMessage("$$start")}else if(useNode){_p.child||(_p.child
|