13 lines
250 KiB
Vue
13 lines
250 KiB
Vue
|
/*!
|
||
|
* g6 v1.1.3 (http://antv.alipay.com/g6/doc/index.html)
|
||
|
* Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
|
||
|
* Licensed under the GNU General Public License v2.0
|
||
|
*/
|
||
|
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("G6",[],e):"object"==typeof exports?exports.G6=e():t.G6=e()}(this,function(){return function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={exports:{},id:i,loaded:!1};return t[i].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";var i={},r=n(31);i.Color=n(89),i.Layout=n(32),i.Math=n(8),i.Matrix=n(3),i.Tween=n(33),i.Canvas=n(10),i.Graph=n(13),i.Net=n(160),i.Tree=n(163),i.Global=i.Graph.Global,i.Handler=i.Graph.Handler,i.Shape=i.Graph.Shape,i.Util=i.Graph.Util,i.Item=i.Graph.Item,i.registNode=i.Graph.registNode,i.registEdge=i.Graph.registEdge,i.registBehaviour=i.Handler.registBehaviour,r.tracking=!0,i.track=function(t){r.tracking=t},n(166),t.exports=i},function(t,e,n){var i=n(85);t.exports=i},function(t,e){"use strict";var n={resetMode:function(t,e){var i;e._off();for(var r=0;r<t.length;r++)i=n[t[r]],i&&i(e)},registBehaviour:function(t,e){n[t]=e}};t.exports=n},function(t,e,n){var i={Matrix3:n(66),Vector2:n(67),Vector3:n(68)};t.exports=i},function(t,e,n){"use strict";var i=n(1),r=n(30),a=n(17),o=n(29),s=n(129),u=n(132),c=n(62),h={};i.mix(h,i,o,r,a,u,c,s),t.exports=h},function(t,e){"use strict";t.exports={colors:["#4E7CCC","#36B3C3","#4ECDA5","#94E08A","#E2F194","#EDCC72","#F8AB60","#F9815C","#EB4456","#C82B3D"],guide:{},grid:{line:{stroke:"#F5F5F5",lineWidth:1},forceAlign:!0,cell:10},nodeStyle:{stroke:"#666",fill:"#fff",lineWidth:1,radius:4,fillOpacity:.1},nodeDelegationStyle:{stroke:"#108EE9",lineDash:[3,3]},edgeDelegationStyle:{stroke:"#108EE9",lineDash:[3,3]},nodePadding:[8,16],nodeLabelStyle:{fill:"#666",textAlign:"center",textBaseline:"middle",fontSize:14},edgeStyle:{lineWidth:1,stroke:"#999",lineAppendWidth:10},edgeLabelStyle:{fill:"#666",textAlign:"center",textBaseline:"middle"},edgeLabelRectStyle:{fill:"white"},anchorPointStyle:{fill:"#108EE9",lineWidth:.1,r:4},anchorPointHoverStyle:{lineWidth:6,stroke:"#108EE9",strokeOpacity:.2},frameRectStyle:{fill:"blue",opacity:.1},nodeControlPointStyle:{r:4,fill:"#fff",shadowBlur:4,shadowColor:"#666"},edgeControlPointStyle:{r:4,fill:"#fff",shadowBlur:4,shadowColor:"#666"},nodeAcitveBoxStyle:{stroke:"#108EE9",lineDash:[3,3]},zIndex:{node:1,edge:0,nodeLabel:5,edgeLabel:4,edgeLabelBackground:3},treeButtonStyle:{fill:"#fff",stroke:"#333"},wheelZoomTimeout:200,toolTipTimeout:200,treeButtonRadius:6,treeButtonPadding:3,fitViewPadding:10,updateDuration:450,enterDuration:450,leaveDuration:450,preciseAnchor:!1,updateEasing:"easeOutQuart",enterEasing:"easeOutQuart",leaveEasing:"easeOutQuart",fontFamily:'"Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "\u5fae\u8f6f\u96c5\u9ed1", SimSun, "sans-serif"'}},function(t,e,n){var i=n(1),r=n(39),a=n(7),o=n(3).Vector3,s=function(t){s.superclass.constructor.call(this,t)};s.ATTRS={},i.extend(s,r),i.augment(s,{isShape:!0,createPath:function(){},drawInner:function(t){var e=this,n=e.__attrs;e.createPath(t);var r=t.globalAlpha;if(e.hasFill()){var a=n.fillOpacity;i.isNull(a)||1===a?t.fill():(t.globalAlpha=a,t.fill(),t.globalAlpha=r)}if(e.hasStroke()){var o=e.__attrs.lineWidth;if(o>0){var s=n.strokeOpacity;i.isNull(s)||1===s||(t.globalAlpha=s),t.stroke()}}},isPointInPath:function(){return!1},isHitBox:function(){return!0},isHit:function(t,e){var n=this,i=new o(t,e,1);if(n.invert(i),n.isHitBox()){var r=n.getBBox();if(r&&!a.box(r.minX,r.maxX,r.minY,r.maxY,i.x,i.y))return!1}var s=n.__attrs.clip;return s?!!s.inside(t,e)&&n.isPointInPath(i.x,i.y):n.isPointInPath(i.x,i.y)},calculateBox:function(){return null},clearTotalMatrix:function(){this.__cfg.totalMatrix=null,this.__cfg.region=null},clearBBox:function(){this.__cfg.box=null,this.__cfg.region=null},getBBox:function(){var t=this.__cfg.box;return t||(t=this.calculateBox(),t&&(t.x=t.minX,t.y=t.minY,t.width=t.maxX-t.minX,t.height=t.maxY-t.minY),this.__cfg.box=t),t}}),t.exports=s},function(t,e,n){var i=n(21),r=n(22),a=n(16),o=n(20);t.exports={line:function(t,e,n,r,a,o,s){v
|
||
|
var t=this;t.rootNode=new r(t.root,t.options)},t.prototype.doLayout=function(){throw new Error("please override this method")},t.prototype.getNodes=function(){var t=this,e=t.doLayout();e.translate(-(e.x+e.width/2+e.hgap),-(e.y+e.height/2+e.vgap));var n=[];return e.eachNode(function(e){var i=e.data;i.x=e.x+e.width/2+e.hgap,i.y=e.y+e.height/2+e.vgap,i.align=e.align,i.inAnchor=e.inAnchor?[e.inAnchor.x,e.inAnchor.y]:null,i.outAnchor=e.outAnchor?[e.outAnchor.x,e.outAnchor.y]:null,t.options.callback(e),n.push(i)}),n},t.prototype.getEdges=function(){var t=this,e=t.options,n=e.extraEdges,i=this.rootNode,r=[];return i.eachNode(function(t){t.children.forEach(function(e){r.push({id:t.id+"-"+e.id,source:t.id,target:e.id})})}),r.concat(n),r},t}();t.exports=o},function(t,e,n){"use strict";var i=n(18),r=n(30),a=n(9),o=n(8),s=i[0];t.exports=function(t,e,n){var u=e.direction||s;if(e.isHorizontal=r(u),u&&i.indexOf(u)===-1)throw new TypeError("Invalid direction: "+u);if(u===i[0])n(t,e),a(t,"L","R",e);else if(u===i[1])n(t,e),t.right2left(),a(t,"R","L",e);else if(u===i[2])n(t,e),a(t,"T","B",e);else if(u===i[3])n(t,e),t.bottom2top(),a(t,"B","T",e);else if(u===i[4]||u===i[5]){var c=o(t,e),h=c.left,l=c.right;n(h,e),n(l,e),e.isHorizontal?(a(h,"R","L",e),a(l,"L","R",e)):(a(h,"B","T",e),a(l,"T","B",e)),e.isHorizontal?h.right2left():h.bottom2top(),l.translate(h.x-l.x,h.y-l.y),t.x=h.x,t.y=l.y,a(t,"C","C",e,!0);var d=t.getBoundingBox();e.isHorizontal?d.top<0&&t.translate(0,-d.top):d.left<0&&t.translate(-d.left,0)}return t}},function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r=n(16),a=2*r,o=r,s={getId:function(t){return t.id||t.name},getHGap:function(t){return t.hgap||o},getVGap:function(t){return t.vgap||o},getChildren:function(t){return t.children},getHeight:function(t){return t.height||a},getWidth:function(t){var e=t.name||" ";return t.width||e.split("").length*r}},u=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments[2];i(this,t);var a=this;if(a.vgap=a.hgap=0,e instanceof t)return e;a.data=e;var o=(n.getHGap||s.getHGap)(e),u=(n.getVGap||s.getVGap)(e);if(a.width=(n.getWidth||s.getWidth)(e),a.height=(n.getHeight||s.getHeight)(e),a.id=(n.getId||s.getId)(e),a.x=a.y=0,a.inAnchor={x:0,y:.5},a.outAnchor={x:1,y:.5},a.depth=0,!r&&!e.isCollapsed)for(var c=[a],h=void 0;h=c.pop();)if(!h.data.isCollapsed){var l=(n.getChildren||s.getChildren)(h.data),d=l?l.length:0;if(h.children=[],l&&d)for(var f=0;f<d;f++){var g=new t(l[f],n);h.children.push(g),c.push(g),g.parent=h,g.depth=h.depth+1}}a.children||(a.children=[]),a.addGap(o,u)}return t.prototype.isRoot=function(){return 0===this.depth},t.prototype.isLeaf=function(){return 0===this.children.length},t.prototype.addGap=function(t,e){var n=this;n.hgap+=t,n.vgap+=e,n.width+=2*t,n.height+=2*e},t.prototype.eachNode=function(t){for(var e=this,n=[e],i=null;i=n.pop();)t(i),n=n.concat(i.children)},t.prototype.DFTraverse=function(t){this.eachNode(t)},t.prototype.BFTraverse=function(t){for(var e=this,n=[e],i=null;i=n.shift();)t(i),n=n.concat(i.children)},t.prototype.getBoundingBox=function(){var t={left:Number.MAX_VALUE,top:Number.MAX_VALUE,width:0,height:0};return this.eachNode(function(e){t.left=Math.min(t.left,e.x),t.top=Math.min(t.top,e.y),t.width=Math.max(t.width,e.x+e.width),t.height=Math.max(t.height,e.y+e.height)}),t},t.prototype.translate=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.eachNode(function(n){n.x+=t,n.y+=e})},t.prototype.right2left=function(){var t=this,e=t.getBoundingBox();t.eachNode(function(t){t.x=t.x-2*(t.x-e.left)-t.width}),t.translate(e.width,0)},t.prototype.bottom2top=function(){var t=this,e=t.getBoundingBox();t.eachNode(function(t){t.y=t.y-2*(t.y-e.top)-t.height}),t.translate(0,e.height)},t.prototype.getCenterX=function(){var t=this;return t.x+t.width/2},t.prototype.getCenterY=function(){var t=this;return t.y+t.height/2},t.prototype.getActualWidth=function(){var t=this;return t.widt
|
||
|
this.renderer.start()}}),t.exports=a},function(t,e,n){"use strict";var i={CompactBoxTree:n(23),Dendrogram:n(24),IndentedTree:n(25),LayeredTidyTree:n(26),TreeLayout:n(2),Flow:n(20),Force:n(21),Linear:n(6),Sankey:n(7)};t.exports=i},function(t,e,n){"use strict";function i(t,e){for(var n=Object.getOwnPropertyNames(e),i=0;i<n.length;i++){var r=n[i],a=Object.getOwnPropertyDescriptor(e,r);a&&a.configurable&&void 0===t[r]&&Object.defineProperty(t,r,a)}return t}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):i(t,e))}var s=n(2),u=n(5),c=n(3),h=function(t){function e(){return r(this,e),a(this,t.apply(this,arguments))}return o(e,t),e.prototype.doLayout=function(){t.prototype._prepareRoot.call(this);var e=this;return e.options.forceAlign="R",c(e.rootNode,e.options,u)},e}(s);t.exports=h},function(t,e,n){"use strict";function i(t,e){for(var n=Object.getOwnPropertyNames(e),i=0;i<n.length;i++){var r=n[i],a=Object.getOwnPropertyDescriptor(e,r);a&&a.configurable&&void 0===t[r]&&Object.defineProperty(t,r,a)}return t}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):i(t,e))}var s=n(2),u=n(14),c=n(3),h=function(t){function e(){return r(this,e),a(this,t.apply(this,arguments))}return o(e,t),e.prototype.doLayout=function(){t.prototype._prepareRoot.call(this);var e=this,n=e.rootNode,i=e.options;return n.width=0,c(n,i,u),n},e}(s);t.exports=h},function(t,e,n){"use strict";function i(t,e){for(var n=Object.getOwnPropertyNames(e),i=0;i<n.length;i++){var r=n[i],a=Object.getOwnPropertyDescriptor(e,r);a&&a.configurable&&void 0===t[r]&&Object.defineProperty(t,r,a)}return t}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):i(t,e))}var s=n(2),u=n(15),c=n(9),h=n(8),l=["LR","RL","H"],d=l[0],f=function(t){function e(){return r(this,e),a(this,t.apply(this,arguments))}return o(e,t),e.prototype.doLayout=function(){t.prototype._prepareRoot.call(this);var e=this,n=e.rootNode,i=e.options;i.isHorizontal=!0;var r=i.indent;e.options.forceAlign="R";var a=i.direction||d;if(a&&l.indexOf(a)===-1)throw new TypeError("Invalid direction: "+a);if(a===l[0])u(n,r),c(n,"L","L",i);else if(a===l[1])u(n,r),n.right2left(),c(n,"R","R",i);else if(a===l[2]){var o=h(n,i),s=o.left,f=o.right;u(s,r),s.right2left(),c(s,"R","R",i),u(f,r),c(f,"L","L",i);var g=s.getBoundingBox();f.translate(g.width,0),n.x=f.x-n.width/2,c(n,"B","B",i,!0)}return n},e}(s);t.exports=f},function(t,e,n){"use strict";function i(t,e){for(var n=Object.getOwnPropertyNames(e),i=0;i<n.length;i++){var r=n[i],a=Object.getOwnPropertyDescriptor(e,r);a&&a.configurable&&void 0===t[r]&&Object.defineProperty(t,r,a)}return t}function r(t
|
||
|
var i=n(1),r=n(6),a=n(7),o=function(t){o.superclass.constructor.call(this,t)};o.ATTRS={points:null,lineWidth:1},i.extend(o,r),i.augment(o,{canFill:!0,canStroke:!0,type:"polygon",getDefaultAttrs:function(){return{lineWidth:1}},calculateBox:function(){var t=this,e=t.__attrs,n=e.points,r=e.lineWidth;if(!n||0===n.length)return null;var a=1/0,o=1/0,s=-(1/0),u=-(1/0);i.each(n,function(t){var e=t[0],n=t[1];e<a&&(a=e),e>s&&(s=e),n<o&&(o=n),n>u&&(u=n)});var c=r/2;return{minX:a-c,minY:o-c,maxX:s+c,maxY:u+c}},isPointInPath:function(t,e){var n=this,i=n.hasFill(),r=n.hasStroke();return i&&r?n.__isPointInFill(t,e)||n.__isPointInStroke(t,e):i?n.__isPointInFill(t,e):!!r&&n.__isPointInStroke(t,e)},__isPointInFill:function(t,e){var n=this,i=n.get("context");return n.createPath(),i.isPointInPath(t,e)},__isPointInStroke:function(t,e){var n=this,i=n.__attrs,r=i.points;if(r.length<2)return!1;var o=i.lineWidth,s=r.slice(0);return r.length>=3&&s.push(r[0]),a.polyline(s,o,t,e)},createPath:function(t){var e=this,n=e.__attrs,r=n.points;r.length<2||(t=t||e.get("context"),t.beginPath(),i.each(r,function(e,n){0===n?t.moveTo(e[0],e[1]):t.lineTo(e[0],e[1])}),t.closePath())}}),t.exports=o},function(t,e,n){var i=n(1),r=n(6),a=n(7),o=n(12),s=n(21),u=n(3),c=u.Vector2,h=function(t){h.superclass.constructor.call(this,t)};h.ATTRS={points:null,lineWidth:1,arrow:!1,tCache:null},i.extend(h,r),i.augment(h,{canStroke:!0,type:"polyline",tCache:null,getDefaultAttrs:function(){return{lineWidth:1,arrow:!1}},calculateBox:function(){var t=this,e=t.__attrs,n=e.lineWidth,r=e.points;if(!r||0===r.length)return null;var a=1/0,o=1/0,s=-(1/0),u=-(1/0);i.each(r,function(t){var e=t[0],n=t[1];e<a&&(a=e),e>s&&(s=e),n<o&&(o=n),n>u&&(u=n)});var c=n/2;return{minX:a-c,minY:o-c,maxX:s+c,maxY:u+c}},__setTcache:function(){var t,e,n=this,r=n.__attrs,a=r.points,o=0,u=0,c=[];a&&0!==a.length&&(i.each(a,function(t,e){a[e+1]&&(o+=s.len(t[0],t[1],a[e+1][0],a[e+1][1]))}),o<=0||(i.each(a,function(n,i){a[i+1]&&(t=[],t[0]=u/o,e=s.len(n[0],n[1],a[i+1][0],a[i+1][1]),u+=e,t[1]=u/o,c.push(t))}),this.tCache=c))},isPointInPath:function(t,e){var n=this,i=n.__attrs;if(n.hasStroke()){var r=i.points;if(r.length<2)return!1;var o=i.lineWidth;return a.polyline(r,o,t,e)}return!1},createPath:function(t){var e,n,i=this,r=i.__attrs,a=r.points,s=r.arrow,u=r.lineWidth;if(!(a.length<2)){for(t=t||i.get("context"),t.beginPath(),t.moveTo(a[0][0],a[0][1]),n=1,e=a.length-1;n<e;n++)t.lineTo(a[n][0],a[n][1]);if(s){var h=new c(a[e][0]-a[e-1][0],a[e][1]-a[e-1][1]),l=o.getEndPoint(h,new c(a[e][0],a[e][1]),u);t.lineTo(l.x,l.y),o.makeArrow(t,h,l,u)}else t.lineTo(a[e][0],a[e][1])}},getPoint:function(t){var e,n,r=this.__attrs,a=r.points,o=this.tCache;return o||(this.__setTcache(),o=this.tCache),i.each(o,function(i,r){t>=i[0]&&t<=i[1]&&(e=(t-i[0])/(i[1]-i[0]),n=r)}),{x:s.at(a[n][0],a[n+1][0],e),y:s.at(a[n][1],a[n+1][1],e)}}}),t.exports=h},function(t,e,n){var i=n(1),r=n(6),a=n(7),o=n(12),s=n(22),u=n(3).Vector2,c=function(t){c.superclass.constructor.call(this,t)};c.ATTRS={p1:null,p2:null,p3:null,lineWidth:1,arrow:!1},i.extend(c,r),i.augment(c,{canStroke:!0,type:"quadratic",getDefaultAttrs:function(){return{lineWidth:1,arrow:!1}},calculateBox:function(){var t,e,n=this,r=n.__attrs,a=r.p1,o=r.p2,u=r.p3;if(i.isNull(a)||i.isNull(o)||i.isNull(u))return null;var c=r.lineWidth/2,h=s.extrema(a[0],o[0],u[0]);for(t=0,e=h.length;t<e;t++)h[t]=s.at(a[0],o[0],u[0],h[t]);h.push(a[0],u[0]);var l=s.extrema(a[1],o[1],u[1]);for(t=0,e=l.length;t<e;t++)l[t]=s.at(a[1],o[1],u[1],l[t]);return l.push(a[1],u[1]),{minX:Math.min.apply(Math,h)-c,maxX:Math.max.apply(Math,h)+c,minY:Math.min.apply(Math,l)-c,maxY:Math.max.apply(Math,l)+c}},isPointInPath:function(t,e){var n=this,i=n.__attrs,r=i.p1,o=i.p2,s=i.p3,u=i.lineWidth;return a.quadraticline(r[0],r[1],o[0],o[1],s[0],s[1],u,t,e)},createPath:function(t){var e=this,n=e.__attrs,r=n.p1,a=n.p2,s=n.p3,c=n.lineWidth,h=n.arrow;if(!(i.isNull(r)||i.isNull(a)||i.isNull(s)))if(t=t||e.get("context"),t.beginPath(),t.moveTo(r[0],r[1]),h){var l=new u(s[0]-a[0],s[1]-a[1]),d=o.getEndPoint(l,new u(s[0],s[1]),c);t.quadraticCurveTo(a
|
||
|
deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074}},function(t,e,n){"use strict";var i=n(1),r=n(8),a=function(){this.h=0,this.s=0,this.l=0};i.augment(a,{type:"hsl",setHSL:function(t,e,n,i){this.h=r.mod(t,1),this.s=r.clamp(e,0,1),this.l=r.clamp(n,0,1),void 0!==i?this.a=r.clamp(i,0,1):this.a=void 0},toRGB:function(){function t(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}return function(){var e=this,n=e.h,i=e.s,r=e.l;if(0===i)return{r:r,g:r,b:r,a:e.a};var a=r<=.5?r*(1+i):r+i-r*i,o=2*r-a;return{r:t(o,a,n+1/3),g:t(o,a,n),b:t(o,a,n-1/3),a:e.a}}}(),clone:function(){var t=new a;return t.h=this.h,t.s=this.s,t.l=this.l,t.a=this.a,t},copy:function(t){return this.h=t.h,this.s=t.s,this.l=t.l,this.a=t.a,this},getStyle:function(){var t=this;return void 0===t.a?"hsl("+Math.round(360*t.h)+", "+Math.round(100*t.s)+"%, "+Math.round(100*t.l)+"%)":"hsla("+Math.round(360*t.h)+", "+Math.round(100*t.s)+"%, "+Math.round(100*t.l)+"%, "+t.a+")"}}),t.exports=a},function(t,e,n){"use strict";var i=n(1),r=n(8),a=function(){this.r=0,this.g=0,this.b=0,this.type="rgb"};i.augment(a,{type:"rgb",setRGB:function(t,e,n,i){this.r=r.clamp(t,0,1),this.g=r.clamp(e,0,1),this.b=r.clamp(n,0,1),void 0!==i?this.a=r.clamp(i,0,1):this.a=void 0},toHSL:function(){var t,e,n=this.r,i=this.g,r=this.b,a=Math.max(n,i,r),o=Math.min(n,i,r),s=(o+a)/2;if(o===a)t=0,e=0;else{var u=a-o;switch(e=s<=.5?u/(a+o):u/(2-a-o),a){case n:t=(i-r)/u+(i<r?6:0);break;case i:t=(r-n)/u+2;break;case r:t=(n-i)/u+4}t/=6}return{h:t,s:e,l:s,a:this.a}},getHex:function(){var t=255*this.r<<16^255*this.g<<8^255*this.b<<0;return"#"+("000000"+t.toString(16)).slice(-6)},getStyle:function(){return void 0===this.a?"rgb("+Math.round(255*this.r).toString()+", "+Math.round(255*this.g).toString()+", "+Math.round(255*this.b).toString()+")":"rgba("+Math.round(255*this.r).toString()+", "+Math.round(255*this.g).toString()+", "+Math.round(255*this.b).toString()+", "+this.a+")"},getPreStyle:function(){return void 0===this.a?"rgb("+Math.round(100*this.r).toString()+"%, "+Math.round(100*this.g).toString()+"%, "+Math.round(100*this.b).toString()+"%)":"rgba("+Math.round(100*this.r).toString()+"%, "+Math.round(100*this.g).toString()
|
||
|
n.call(e,t)}),t.bubbles){var a=e.get("parent");a&&!t.propagationStopped&&a.trigger(t)}return e},fire:function(t,e){var n=new r(t);i.each(e,function(t,e){n[e]=t}),this.trigger(n)}}},function(t,e,n){"use strict";var i=n(1),r=n(69),a=function(t){this.canvas=t,this.el=t.get("el"),this.current=null,this.pre=null};i.augment(a,{tryTrigger:function(t,e){t.__listeners&&t.trigger(e)},getCurrent:function(t){var e=this.canvas,n=e.getPointByClient(t.clientX,t.clientY);this.point=n,this.pre=this.current,this.current=e.getShape(n.x,n.y)},mousemove:function(t){this.getCurrent(t);var e=this.point,n=this.canvas;if(n.has("canvas-mousemove")){var i=new r("canvas-mousemove",t,!0,!0);i.x=e.x,i.y=e.y,i.clientX=t.clientX,i.clientY=t.clientY,i.currentTarget=n,this.tryTrigger(n,i)}if(this.pre&&this.pre!==this.current){var a=new r("mouseleave",t,!0,!0);a.x=e.x,a.y=e.y,a.clientX=t.clientX,a.clientY=t.clientY,a.currentTarget=this.pre,a.target=this.pre,this.tryTrigger(this.pre,a)}if(this.current){var o=new r("mousemove",t,!0,!0);if(o.x=e.x,o.y=e.y,o.clientX=t.clientX,o.clientY=t.clientY,o.currentTarget=this.current,o.target=this.current,this.tryTrigger(this.current,o),this.pre!==this.current){var s=new r("mouseenter",t,!0,!0);s.x=e.x,s.y=e.y,s.clientX=t.clientX,s.clientY=t.clientY,s.currentTarget=this.current,s.target=this.current,this.tryTrigger(this.current,s)}}},mousedown:function(t){var e=this.point,n=this.canvas;if(n.has("canvas-mousedown")){var i=new r("canvas-mousedown",t,!0,!0);i.x=e.x,i.y=e.y,i.clientX=t.clientX,i.clientY=t.clientY,i.currentTarget=n,this.tryTrigger(n,i)}if(this.current){var a=new r("mousedown",t,!0,!0);a.x=e.x,a.y=e.y,a.clientX=t.clientX,a.clientY=t.clientY,a.currentTarget=this.current,a.target=this.current,this.tryTrigger(this.current,a)}},mouseup:function(t){var e=this.point,n=this.canvas;if(n.has("canvas-mouseup")){var i=new r("canvas-mouseup",t,!0,!0);i.x=e.x,i.y=e.y,i.clientX=t.clientX,i.clientY=t.clientY,i.currentTarget=n,this.tryTrigger(n,i)}if(this.current){var a=new r("mouseup",t,!0,!0);a.x=e.x,a.y=e.y,a.clientX=t.clientX,a.clientY=t.clientY,a.currentTarget=this.current,a.target=this.current,this.tryTrigger(this.current,a)}},click:function(t){this.getCurrent(t);var e=this.point,n=this.canvas;if(n.has("canvas-click")){var i=new r("canvas-click",t,!0,!0);i.x=e.x,i.y=e.y,i.clientX=t.clientX,i.clientY=t.clientY,i.currentTarget=n,this.tryTrigger(n,i)}if(this.current){var a=new r("click",t,!0,!0);a.x=e.x,a.y=e.y,a.clientX=t.clientX,a.clientY=t.clientY,a.currentTarget=this.current,a.target=this.current,this.tryTrigger(this.current,a)}},dblclick:function(t){var e=this.point,n=this.canvas;if(n.has("canvas-dblclick")){var i=new r("canvas-dblclick",t,!0,!0);i.x=e.x,i.y=e.y,i.clientX=t.clientX,i.clientY=t.clientY,i.currentTarget=n,this.tryTrigger(n,i)}if(this.current){var a=new r("dblclick",t,!0,!0);a.x=e.x,a.y=e.y,a.clientX=t.clientX,a.clientY=t.clientY,a.currentTarget=this.current,a.target=this.current,this.tryTrigger(this.current,a)}},mouseout:function(t){var e=this.point,n=this.canvas,i=new r("canvas-mouseleave",t,!0,!0);i.x=e.x,i.y=e.y,i.currentTarget=n,this.tryTrigger(n,i)},mouseover:function(t){var e=this.canvas,n=new r("canvas-mouseenter",t,!0,!0);n.currentTarget=e,this.tryTrigger(e,n)}}),t.exports=a},function(t,e,n){function i(t,e,n){for(var i,r=t.length-1;r>=0;r--){var a=t[r];if(a.__cfg.visible&&a.__cfg.capture&&(a.isGroup?i=a.getShape(e,n):a.isHit(e,n)&&(i=a)),i)break}return i}function r(t){if(!t.__cfg&&t!==h){var e=t.superclass.constructor;e&&!e.__cfg&&r(e),t.__cfg={},a.mix(!0,t.__cfg,e.__cfg),a.mix(!0,t.__cfg,t.CFG)}}var a=n(1),o=n(3).Vector3,s=n(39),u=n(48),c={},h=function(t){h.superclass.constructor.call(this,t),this.set("children",[]),this._beforeRenderUI(),this._renderUI(),this._bindUI()};a.extend(h,s),a.augment(h,{isGroup:!0,canFill:!0,canStroke:!0,getDefaultCfg:function(){return r(this.constructor),a.mix(!0,{},this.constructor.__cfg)},_beforeRenderUI:function(){},_renderUI:function(){},_bindUI:function(){},addShape:function(t,e){var n,i=this.get("canvas");e=e||{};var r=c[t];if(r||(r=a.ucfirst(t),c[t]=r),e.at
|
||
|
},function(t,e,n){"use strict";var i=n(10).G,r=n(4),a=i.Group,o=function t(e){t.superclass.constructor.call(this,e)};r.extend(o,a),r.augment(o,{drawInner:function(t){var e,n,i=this;i.traverseChildren(function(t){e=t.get("freezePoint"),t.isShape&&e&&t.get("visible")&&(n=i.getMatrix().elements[0],t.initTransform(),t.transform([["t",-e.x,-e.y],["s",1/n,1/n],["t",e.x,e.y]]))}),o.superclass.drawInner.call(this,t)}}),t.exports=o},function(t,e,n){"use strict";function i(t,e){var n=t.get("children");a.each(n,function(n){e(n,t),n.get("children")&&i(n,e)})}var r=n(10),a=n(4),o=n(27),s=r.G,u=function(){};a.augment(u,{traverseChildren:function(t){i(this,t)},radixSort:function(){var t=this.get("children");this.set("children",a.radixSort(t))},clear:function(t){var e=this.get("children");for(t=t!==!1;0!==e.length;)e[e.length-1].remove(t);return this},findByCFG:function(t,e){var n=this.get("children"),i=[];return a.each(n,function(n){n.get(t)===e&&i.push(n)}),i}}),a.mixin(s.Group,[u,o]),t.exports=u},function(t,e,n){"use strict";function i(t,e){var n=e.elements,i=n[0]*t.x+n[3]*t.y+n[6],r=n[1]*t.x+n[4]*t.y+n[7];return t.x=i,t.y=r,t}function r(t){var e=t.fill,n=t.fillOpacity,i=new o(e);return t.stroke&&(t.border=""+t.lineWidth+"px solid "+t.stroke),e&&n?void(t["background-color"]="rgba("+255*i.getR()+", "+255*i.getG()+", "+255*i.getB()+", "+n+")"):void(e&&(t.fill=e))}var a=n(10),o=n(15),s=n(48),u=n(4),c=a.G,h=function t(e){t.superclass.constructor.call(this,e)};h.ATTRS={x:0,y:0,width:0,height:0,fillOpacity:1,lineWidth:1},u.extend(h,c.Shape),u.augment(h,{canFill:!0,type:"html",__isPointInFill:function(t,e){var n=this.getBBox(),i=n.minX,r=n.minY,a=n.maxX-n.minX,o=n.maxY-n.minY;return i<=t&&t<=i+a&&r<=e&&e<=r+o},getDefaultAttrs:function(){return h.ATTRS},init:function(){var t,e,n=this.get("canvas"),i=this.get("attrs"),r=this.get("autoSize"),a=n.get("htmlElementContaniner"),o=i.html,s=i.cx,c=i.cy,h=u.createDOM(o,{position:"absolute",visibility:"hidden"});a.appendChild(h),r&&(t=h.width(),e=h.height(),this.attr("x",s-t/2),this.attr("y",c-e/2),this.attr("width",t),this.attr("height",e)),this.set("dom",h)},attr:function(t,e){var n=this.get("attrs");return u.isObject(t)?(u.mix(n,t),r(n),void 0===t.x&&void 0===t.y&&void 0===t.width&&void 0===t.height||this.calculateBox(),n):u.isNull(e)?n[t]:(n[t]=e,r(n),"x"!==t&&"y"!==t&&"width"!==t&&"height"!==t||this.calculateBox(),this)},calculateBox:function(){var t=this.attr("x"),e=this.attr("y"),n=this.attr("width"),i=this.attr("height"),r=this.attr("lineWidth");return{minX:t-r/2,minY:e-r/2,maxX:t+n+r/2,maxY:e+i+r/2}},isPointInPath:function(t,e){return this.__isPointInFill(t,e)},applyTransform:function(){var t=this.get("dom"),e=this.get("canvas"),n=e.get("pixelRatio"),r=this.getTotalMatrix(),a=this.attr("x"),o=this.attr("y"),s=this.attr("width"),u=this.attr("height"),c=i({x:a,y:o},r),h=i({x:a+s,y:o+u},r);t.css({left:c.x/n+"px",top:c.y/n+"px",width:(h.x-c.x)/n+"px",height:(h.y-c.y)/n+"px"})},tryAdd:function(){var t=this.get("canvas"),e=t.get("htmlElementContaniner"),n=this.get("dom");n.parentNode!==e&&e.appendChild(n)},createPath:function(){var t=this.get("dom"),e=this.get("attrs");this.tryAdd(),this.applyTransform(),t.css(u.mix({visibility:"visible"},e))},destroy:function(){var t=this.get("dom");t&&(u.isFunction(t.g6Destroy)&&t.g6Destroy(),t.destroy()),h.superclass.destroy.call(this)}}),s.Html=h,t.exports=h},function(t,e,n){"use strict";var i=n(1),r=n(10),a=n(27),o=r.G,s=function(){};i.augment(s,{getAllAttrs:function(){var t=this,e=t.get("attrs"),n={};return i.each(e,function(e,i){n[i]=t.attr(i)}),n}}),i.mixin(o.Shape,[s,a]),t.exports=s},function(t,e,n){"use strict";function i(t,e,n){return new a({width:t,height:e,eventEnable:!1,containerDOM:n})}var r=n(11),a=n(10),o=n(4),s=n(125),u=n(123),c=n(124),h=n(126),l=n(121),d=n(60),f=n(59),g=n(110),p=n(109),v=n(112),x=n(108),m=n(111),y=n(5),w=n(58),b=n(113),_=n(25),M=f.Node,S=f.Edge,A=function t(e){t.superclass.constructor.call(this,e),this._init()};A.ATTRS={id:null,container:null,graphContainer:null,width:null,height:500,addingType:"",itemCache:null,items:[],nodes:[
|
||
|
return!!r.isFunction(i.getAnchorPoints)&&i.getAnchorPoints(e,n)}}),a.registNode("rect",{draw:function(t,e){return r.drawNode("rect",t,e)},getAnchorPoints:i}),a.registNode("rhombus",{draw:function(t,e){return r.drawNode("rhombus",t,e)},getAnchorPoints:i}),a.registNode("text",{draw:function(t,e){return r.drawNode("text",t,e)},getAnchorPoints:i}),a.registNode("image",{draw:function(t,e){return r.drawNode("image",t,e)},getAnchorPoints:i}),a.registNode("html",{getHtml:function(t){return t.origin.html},cssSize:!1,draw:function(t,e){return t.html=this.getHtml(t,e),this.cssSize&&(t.size="auto"),r.drawNode("html",t,e)},getAnchorPoints:function(){return[[0,.25],[0,.5],[0,.75],[1,.25],[1,.5],[1,.75],[.25,0],[.5,0],[.75,0],[.25,1],[.5,1],[.75,1]]}}),a.registNode("circle",{draw:function(t,e){return r.drawNode("circle",t,e)},getAnchorPoints:function(){return[[.5-o,.5-o],[.5,0],[.5+o,.5-o],[1,.5],[.5+o,.5+o],[.5,1],[.5-o,.5+o],[0,.5]]}})},function(t,e,n){"use strict";var i=n(1),r={getDOMHeight:function(t){var e=i.getStyle(t,"height");return parseFloat(e)},getDOMWidth:function(t){var e=i.getStyle(t,"width");return parseFloat(e)},createDOM:function(t,e){var n;return n=i.isString(t)?i.createDom(t):t,n.bbox=n.getBoundingClientRect(),n.hide=function(){return n.style.visibility="hidden",n},n.show=function(){return n.style.visibility="visible",n},n.css=function(t){return i.modiCSS(n,t),n},n.width=function(){return r.getDOMWidth(n)},n.height=function(){return r.getDOMHeight(n)},n.paddingLeft=function(){return parseFloat(i.getStyle(n,"padding-left"))},n.paddingRight=function(){return parseFloat(i.getStyle(n,"padding-right"))},n.paddingTop=function(){return parseFloat(i.getStyle(n,"padding-top"))},n.paddingBottom=function(){return parseFloat(i.getStyle(n,"padding-bottom"))},n.destroy=function(){n.parentNode&&n.parentNode.removeChild(n)},n.on=function(t,e){n.addEventListener(t,e)},n.off=function(t,e){n.removeEventListener(t,e)},n.attr=function(t){return n.getAttribute(t)},n.css(e),n}};t.exports=r},function(t,e,n){"use strict";function i(t,e){return Math.abs(t.x-e.x)>Math.abs(t.y-e.y)}function r(t,e,n,r,a){var o=[];if("horizontal"===n)o.push({x:1*(t.x+e.x)/2,y:t.y}),o.push({x:1*(t.x+e.x)/2,y:e.y});else if("vertical"===n)o.push({x:t.x,y:1*(t.y+e.y)/2}),o.push({x:e.x,y:1*(t.y+e.y)/2});else{var s=Math.abs(e.x-t.x),u=Math.abs(e.y-t.y),c=t,h=e;r&&r.getCenter&&(c=r.getCenter()),a&&a.getCenter&&(h=a.getCenter()),i(t,c)||t===c&&u<s?o.push({x:1*(t.x+e.x)/2,y:t.y}):o.push({x:t.x,y:1*(t.y+e.y)/2}),i(e,h)||e===h&&u<s?o.push({x:1*(t.x+e.x)/2,y:e.y}):o.push({x:e.x,y:1*(t.y+e.y)/2})}return o}function a(t,e){var n={x:(t.x+e.x)/2,y:(t.y+e.y)/2},i=h.vector(e,t),r=i.vertical(),a=i.length();return r.setLength(.2*a),[f.add(n,r)]}function o(t,e,n,i){var a=t[0],o=t[t.length-1],s=["M",a.x,a.y],c=r(a,o,i,e,n),h=["C"],l=[s];return u.each(c,function(t){h.push(t.x,t.y)}),h.push(o.x,o.y),l.push(h),l}function s(t,e){var n,i,r=10,a=t.getBBox(),o=a.centerX,s=a.centerY,u=a.height,c=a.width,h=a.maxX,l=a.maxY;if(e=[e.x,e.y],o===e[0]&&(e[1]>=s?(n=r+u/2-Math.abs(s-e[1]),i=[o,e[1]+n]):(n=r+u/2-Math.abs(s-e[1]),i=[o,e[1]-n])),s===e[1]&&(e[0]>=o?(n=r+c/2-Math.abs(o-e[0]),i=[e[0]+n,s]):(n=r+c/2-Math.abs(o-e[0]),i=[e[0]-n,s])),i)return i;var d=Math.abs(o-e[0]),f=Math.abs(s-e[1]),g=Math.sqrt(Math.pow(d,2)+Math.pow(f,2)),p=180*Math.asin(f/g)/Math.PI;return e[0]>=o&&e[0]<=h?e[1]>=s&&e[1]<=l?p>0&&p<=45?(n=r+c/2-Math.abs(o-e[0]),i=[e[0]+n,e[1]]):(n=r+u/2-Math.abs(s-e[1]),i=[e[0],e[1]+n]):p>0&&p<=45?(n=r+c/2-Math.abs(o-e[0]),i=[e[0]+n,e[1]]):(n=r+u/2-Math.abs(s-e[1]),i=[e[0],e[1]-n]):e[1]>=s&&e[1]<=l?p>0&&p<=45?(n=r+c/2-Math.abs(o-e[0]),i=[e[0]-n,e[1]]):(n=r+u/2-Math.abs(s-e[1]),i=[e[0],e[1]+n]):p>0&&p<=45?(n=r+c/2-Math.abs(o-e[0]),i=[e[0]-n,e[1]]):(n=r+u/2-Math.abs(s-e[1]),i=[e[0],e[1]-n]),i}var u=n(1),c=n(3),h=n(30),l=n(17),d=n(131),f=c.Vector2,g={polyLineFlow:function(t,e,n){var i=s(e,t[0]),r=s(n,t[1]);n=n.get("boxStash"),e=e.get("boxStash");var a=new d({source:e,target:n,sourcePosition:[t[0].x,t[0].y],sourceHandlePosition:[i[0],i[1]],targetPosition:[t[1].x,t[1].y],targetHandlePosition:[r[0
|