From ec2be660daf682186cf0db94604b69478f1ad2fd Mon Sep 17 00:00:00 2001 From: wenlele Date: Tue, 5 Dec 2023 14:18:53 +0800 Subject: [PATCH] =?UTF-8?q?actions=20=E7=BB=84=E7=BD=91=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/config.js | 15 +- web-network/client/assets/js/g6/index.js | 8 + web-network/client/index.ejs | 44 +-- web-network/client/index.html | 12 +- .../src/sections/network/actions/network.js | 19 +- .../components/device-tree/edit-map.js | 2 +- .../components/device-tree/zuwang-main.js | 2 +- .../network/containers/device-monitor.js | 96 ++--- .../sections/network/containers/tableShow.js | 341 ------------------ .../client/src/sections/network/index.js | 2 +- 10 files changed, 103 insertions(+), 438 deletions(-) create mode 100644 web-network/client/assets/js/g6/index.js delete mode 100644 web-network/client/src/sections/network/containers/tableShow.js diff --git a/api/config.js b/api/config.js index f582137..b86e3d7 100644 --- a/api/config.js +++ b/api/config.js @@ -228,7 +228,20 @@ const product = { { p: '/project/group/list', o: 'GET' }, { p: '/project/group/:groupId/detail', o: 'GET' }, { p: '/project/workOrders/repairRank', o: 'GET' }, - { p: '/project/workOrders', o: 'GET' } + { p: '/project/workOrders', o: 'GET' }, + { p: '/organizations/:pepProjectId/struc', o: 'GET' }, + { p: '/things/:iotaThingId/deploys', o: 'GET' }, + { p: '/meta/things/:iotaThingId/devices', o: 'GET' }, + { p: '/metrics/things/:iotaThingId/devices/link_status', o: 'GET' }, + { p: '/things/:iotaThingId/deploy', o: 'GET' }, + { p: '/sensors/last/data', o: 'POST' }, + { p: '/meta/things/:iotaThingId/devices', o: 'GET' }, + { p: '/devices/alarms', o: 'POST' }, + { p: '/devices/cardStatus', o: 'POST' }, + { p: '/metrics/devices/:deviceId/link_status', o: 'GET' }, + { p: '/device/:deviceId/alarms', o: 'GET' }, + + ], // 不做认证的路由,也可以使用 exclude: ["*"] 跳过所有路由 apMergeDeVeAnxinProjectId: AP_MERGE_DEVE_ANXINPROJECT_ID, anxinCloud: { diff --git a/web-network/client/assets/js/g6/index.js b/web-network/client/assets/js/g6/index.js new file mode 100644 index 0000000..7276852 --- /dev/null +++ b/web-network/client/assets/js/g6/index.js @@ -0,0 +1,8 @@ +!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(32);i.Color=n(105),i.Layout=n(18),i.Math=n(8),i.Matrix=n(2),i.Tween=n(33),i.Canvas=n(10),i.Graph=n(11),i.Net=n(152),i.Tree=n(81),i.Mind=n(148),i.Global=i.Graph.Global,i.Handler=i.Graph.Handler,i.Shape=i.Graph.Shape,i.Util=i.Graph.Util,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(156),t.exports=i},function(t,e,n){var i=n(101);t.exports=i},function(t,e,n){var i={Matrix3:n(82),Vector2:n(83),Vector3:n(84)};t.exports=i},function(t,e,n){"use strict";function i(t){for(var e=t.superclass.constructor;e.Mode;)t.Mode=r.mix({},e.Mode,t.Mode),e=e.superclass.constructor}var r=n(1),a={resetMode:function(t,e){var n;e._off();for(var i=0;i0){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){var u=i.box(t,e,n,r,a);if(!this.box(u.minX,u.maxX,u.minY,u.maxY,o,s))return!1;var c=i.pointDistance(t,e,n,r,o,s);return!isNaN(c)&&c<=a/2},polyline:function(t,e,n,i){var r=t.length-1;if(r<1)return!1;for(var a=0;a=0&&v<_?(d=m,_=v):(y=new c(i(t,n,a,s,w),i(e,r,o,u,w)),x=y.distanceToSquared(S),w<=1&&x<_?(d=w,_=x):b*=.5);return f&&(f.x=i(t,n,a,s,d),f.y=i(e,r,o,u,d)),Math.sqrt(_)}function o(t,e,n,i){var r,a,o,s=3*t-9*e+9*n-3*i,u=6*e-12*n+6*i,c=3*n-3*i,l=[];if(h.equal(s,0))h.equal(u,0)||(r=-c/u,r>=0&&r<=1&&l.push(r));else{var f=u*u-4*s*c;h.equal(f,0)?l.push(-u/(2*s)):f>0&&(o=Math.sqrt(f),r=(-u+o)/(2*s),a=(-u-o)/(2*s),r>=0&&r<=1&&l.push(r),a>=0&&a<=1&&l.push(a))}return l}function s(t,e,n,i,r){var a=-3*e+9*n-9*i+3*r,o=t*a+6*e-12*n+6*i;return t*o-3*e+3*n}function u(t,e,n,i,r,a,o,u,c){l.isNull(c)&&(c=1),c=c>1?1:c<0?0:c;for(var h=c/2,f=12,d=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],g=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],p=0,v=0;v0;)i-=2*Math.PI;i=i/Math.PI/2*n;var h=a-t+i-2*t;c.push(["M",h,e]);for(var l=0,f=0;f0&&void 0!==arguments[0]?arguments[0]:{};i(this,t);var n=this;n.options=e,a.isFunction(e.callback)||(n.options.callback=function(){})}return t.prototype._prepareRoot=function(){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 f=t.getBoundingBox();e.isHorizontal?f.top<0&&t.translate(0,-f.top):f.left<0&&t.translate(-f.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),f=l?l.length:0;if(h.children=[],l&&f)for(var d=0;d0&&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.width-2*t.hgap},t.prototype.getActualHeight=function(){var t=this;return t.height-2*t.vgap},t.prototype.getAnchorPoint=function(t){var e=this,n=e.getActualWidth(),i=e.getActualHeight();return{x:e.x+e.hgap+n*t.x,y:e.y+e.vgap+i*t.y}},t}();t.exports=u},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e,n){n?t.y+=e:t.x+=e,t.children.forEach(function(t){i(t,e,n)})}function r(t,e){var n=e?t.y:t.x;return t.children.forEach(function(t){n=Math.min(r(t,e),n)}),n}function a(t,e){var n=r(t,e);i(t,-n,e)}function o(t,e,n){n?e.y=t.x:e.x=t.x,t.c.forEach(function(t,i){o(t,e.children[i],n)})}function s(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;e?(t.x=n,n+=t.width):(t.y=n,n+=t.height),t.children.forEach(function(t){s(t,e,n)})}var u=function t(e,i,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];n(this,t);var o=this;o.w=e||0,o.h=i||0,o.y=r||0,o.x=0,o.c=a||[],o.cs=a.length,o.prelim=0,o.mod=0,o.shift=0,o.change=0,o.tl=null,o.tr=null,o.el=null,o.er=null,o.msel=0,o.mser=0};u.fromNode=function(t,e){if(!t)return null;var n=[];return t.children.forEach(function(t){n.push(u.fromNode(t,e))}),e?new u(t.height,t.width,t.x,n):new u(t.width,t.height,t.y,n)},t.exports=function(t){function e(t){if(0===t.cs)return void n(t);e(t.c[0]);for(var r=y(l(t.c[0].el),0,null),a=1;an.low&&(n=n.nxt);var u=a+i.prelim+i.w-(s+o.prelim);u>0&&(s+=u,r(t,e,n.index,u));var g=l(i),p=l(o);g<=p&&(i=h(i),null!==i&&(a+=i.mod)),g>=p&&(o=c(o),null!==o&&(s+=o.mod))}!i&&o?f(t,e,o,s):i&&!o&&d(t,e,i,a)}function r(t,e,n,i){t.c[e].mod+=i,t.c[e].msel+=i,t.c[e].mser+=i,v(t,e,n,i)}function c(t){return 0===t.cs?t.tl:t.c[0]}function h(t){return 0===t.cs?t.tr:t.c[t.cs-1]}function l(t){return t.y+t.h}function f(t,e,n,i){var r=t.c[0].el;r.tl=n;var a=i-n.mod-t.c[0].msel;r.mod+=a,r.prelim-=a,t.c[0].el=t.c[e].el,t.c[0].msel=t.c[e].msel}function d(t,e,n,i){var r=t.c[e].er;r.tr=n;var a=i-n.mod-t.c[e].mser;r.mod+=a,r.prelim-=a,t.c[e].er=t.c[e-1].er,t.c[e].mser=t.c[e-1].mser}function g(t){t.prelim=(t.c[0].prelim+t.c[0].mod+t.c[t.cs-1].mod+t.c[t.cs-1].prelim+t.c[t.cs-1].w)/2-t.w/2}function p(t,e){e+=t.mod,t.x=t.prelim+e,x(t);for(var n=0;n=n.low;)n=n.nxt;return{low:t,index:e,nxt:n}}var m=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},w=m.isHorizontal;s(t,w);var b=u.fromNode(t,w);return e(b),p(b,0),o(b,t,w),a(t,w),t}},function(t,e,n){"use strict";var i=n(1),r=function(t){i.mix(this,t),this._init()};i.augment(r,{nodes:null,edges:null,y:0,hasWeight:!1,idField:"name",valueField:"value",sourceField:"source",targetField:"target",sourceWeightField:"sourceWeight",targetWeightField:"targetWeight",maxValue:null,thickness:.05,margin:.01,detachment:!1,_init:function(){var t=this,e=t.nodes,n=t.valueField,r=t.targetWeightField;if(i.isNull(e)){var a=t.edges.slice(0);t.edges=a,i.isNull(a[0][r])&&(t.targetWeightField=t.sourceWeightField),e=t._createNodes()}else e=e.slice(0),t.nodes=e;t.hasWeight&&i.isNull(e[0][n])&&(t._initNodeMap(),t._calculateValue()),t._setMarginWidth(e)},_createNodes:function(){var t=this,e=t.edges,n=t.sourceField,i=t.targetField,r=[],a={};return e.forEach(function(e){var o=e[n],s=e[i];t._creatNode(o,a,r),t._creatNode(s,a,r)}),t.nodes=r,r},_creatNode:function(t,e,n){if(i.isNull(e[t])){var r={id:t};n.push(r),e[t]=r}},_initNodeMap:function(){var t=this,e=t.idField,n=t.targetField,r=t.sourceField,a=t.nodes;if(i.isObject(a))return a;var o={};return i.each(a,function(a){i.isNull(a.id)&&(a.id=a[e]),i.isNull(a.y)||delete a.y,a.inEdges=t._getEdgeOfCurNode(a,n),a.outEdges=t._getEdgeOfCurNode(a,r),o[a.id]=a}),t.nodesMap=o,t.nodes=a,o},_getEdgeOfCurNode:function(t,e){var n=this.edges,i=n.filter(function(n){return n[e]===t.id});return i},_calculateValue:function(){var t=this,e=t.nodes,n=t.valueField;e.forEach(function(e){i.isNull(e[n])&&t._getValueFromEdges(e)})},_getValueFromEdges:function(t){var e=this.valueField,n=this.sourceField,i=this.targetField,r=this.sourceWeightField,a=this.targetWeightField,o=0,s=this.detachment;if(s){var u=0,c=0;t.outEdges.forEach(function(t){c+=t[r]}),t.inEdges.forEach(function(t){u+=t[a]}),o=Math.max(u,c)}else t.outEdges.forEach(function(t){o+=t[r]}),t.inEdges.forEach(function(t){t[n]!==t[i]&&(o+=t[a])});return t[e]=o,o},_setMarginWidth:function(t){var e=this.margin,n=t.length,i=2*n*e;this.marginWidth=i},getNodes:function(){var t=this,e=t.nodes;return t.hasWeight?t._layoutByWeight(e):t._layout(e),e},_layout:function(t){var e=t.length,n=1/e,i=this.y;t.map(function(t,e){t.x=(e+.5)*n,t.y=i})},_layoutByWeight:function(t){var e=this.y,n=this.marginWidth,i=this.thickness,r=this.valueField,a=0;t.forEach(function(t){a+=t[r]});var o=this.maxValue||a;t.map(function(t){t.weight=t[r]/o,t.width=t.weight*(1-n),t.height=i,t.y=e}),this._layoutX(t)},_layoutX:function(t){var e=this.margin;t.map(function(n,i){for(var r=0,a=i-1;a>=0;a--)r+=t[a].width+2*e;n.x=e+.5*n.width+r})},reset:function(){this._init()}}),t.exports=r},function(t,e,n){"use strict";var i=n(1),r=n(28),a=n(29),o=n(6),s=function(t){i.mix(this,t),this._init()};i.extend(s,o),i.augment(s,{hasWeight:!0,stepField:"step",totalStep:0,calculationTimes:2,_init:function(){var t=this.edges.slice(0);this.edges=t,this._initNode()},_initNode:function(){var t=this,e=t.nodes,n=t.stepField,r=t.valueField;i.isNull(e)?e=t._createNodes():(e=e.slice(0),t.nodes=e),t._initNodeMap(),i.isNull(e[0][n])&&t._calculateStep(),i.isNull(e[0][r])&&t._calculateValue()},_calculateStep:function(){var t=this,e=t.nodes,n=t.stepField;e.forEach(function(e){i.isNull(e[n])&&t._getStepFromEdges(e)});var r=e.filter(function(t){return 0===t.outEdges.length});r.map(function(e){e.step=t.totalStep-1})},_getValueFromEdges:function(t){var e=this.valueField,n=0,i=t.step;return 0===i?t.outEdges.forEach(function(t){n+=t[e]}):t.inEdges.forEach(function(t){n+=t[e]}),t.value=n,n},_getStepFromEdges:function(t){var e=this,n=e.sourceField,r=0;return t.inEdges.length>0&&t.inEdges.forEach(function(t){var a,o=e._findObj(t[n]);a=i.isNull(o.step)?e._getStepFromEdges(o):o.step,r=Math.max(a+1,r)}),t.step=r,e.totalStep=Math.max(e.totalStep,r+1),r},_findObj:function(t){var e=this.nodesMap;return e[t]},getNodes:function(){var t=this,e=t.nodes,n=t.sourceField,r=t.targetField,a=t.stepField,o=t.valueField,s=[],u=[],c=[];e.forEach(function(t){var e=t[a];void 0===u[e]&&(u[e]=[]),u[e].push(t),i.isNull(s[e])?s[e]=t[o]:s[e]+=t[o]}),t.maxValue=Math.max.apply(null,s),t.totalStep=u.length,t._setMarginWidth(u[0]),t._layoutByWeight(u[0]),t._layoutNodes(u,n);for(var h=t.calculationTimes;h>0;h--)t._layoutNodes(u.reverse(),r),t._layoutNodes(u.reverse(),n);return u.forEach(function(t){c=c.concat(t)}),t.normalization(c),c},normalization:function(t){var e=1;t.forEach(function(t){t.x>e&&(e=t.x)}),e>1&&t.map(function(t){t.x=t.x/e,t.width=t.width/e})},_layoutNodes:function(t,e){var n=this;if(t.length>=2){var i;for(i=1;i0&&n.x-.5*n.width<=t[i-1].x+.5*t[i-1].width+2*e&&(n.x=t[i-1].x+.5*t[i-1].width+2*e+.5*n.width)})},_layoutHighStep:function(t,e){var n=this,i=n.valueField,r=n.maxValue,a=n.thickness,o=n.marginWidth,s=n.y,u=e===n.sourceField?n.targetField:n.sourceField;t.map(function(t){var c,h=n._getEdgeOfCurNode(t,u),l=0;h.forEach(function(r){c=n._findObj(r[e]);var a=r[i];l+=c.x*a/t[i]}),t.x=l,t.weight=t[i]/r,t.width=t.weight*(1-o),t.height=a,t.y=void 0===t.y?s:t.y})},getEdges:function(){for(var t=this.calculationTimes;t>0;t--)this._layoutEdges();return this.edges},_layoutEdges:function(){var t=this,e=t.nodes,n=t.stepField,i=t.targetField,r=t.sourceField,a=t.totalStep;e.forEach(function(e){0!==e[n]&&t._edgeSort(e.inEdges,r)}),e.forEach(function(e){e[n]!==a&&t._edgeSort(e.outEdges,i)})},_edgeSort:function(t,e){var n=this,i=n.edges;t.sort(function(t,i){return n._findObj(t[e]).x-n._findObj(i[e]).x}),t.forEach(function(o,s){for(var u=0;un._findObj(o[e]).x?a(i,h,c):r(i,h,c)}})},_findIndex:function(t,e){var n=this.sourceField,i=this.targetField,r=t.findIndex(function(t){return t[n]===e[n]&&t[i]===e[i]});return r}}),t.exports=s},function(t,e,n){"use strict";var i=n(4);t.exports=function(t,e){for(var n=new i(t.data,e,!0),r=new i(t.data,e,!0),a=t.children.length,o=Math.round(a/2),s=0;s3&&void 0!==arguments[3]?arguments[3]:{},a=arguments[4];a?i(t,e,n,r):t.eachNode(function(t){i(t,e,n,r)})}},function(t,e,n){var i=n(11);t.exports=i},function(t,e){"use strict";function n(t,e,i){i=i||0;for(var r in e)if(e.hasOwnProperty(r)){var s=e[r];null!==s&&o.isObject(s)?(o.isObject(t[r])||(t[r]={}),i=0;e--)delete t[e];t.length=0},equalsArray:function(t,e){if(t===e)return!0;if(!t||!e)return!1;if(t.length!==e.length)return!1;for(var n=!0,i=0;i=0;e--)this.nodes[e].id===t.id&&this.nodes.splice(e,1);this.detachNode(t)},e.prototype.detachNode=function(t){var e=this.edges.slice();e.forEach(function(e){e.source.id!==t.id&&e.target.id!==t.id||this.removeEdge(e)},this),this.notify()},e.prototype.removeEdge=function(t){for(var e=this.edges.length-1;e>=0;e--)this.edges[e].id===t.id&&this.edges.splice(e,1);for(var n in this.adjacency){for(var i in this.adjacency[n]){for(var r=this.adjacency[n][i],a=r.length-1;a>=0;a--)this.adjacency[n][i][a].id===t.id&&this.adjacency[n][i].splice(a,1);0==this.adjacency[n][i].length&&delete this.adjacency[n][i]}u(this.adjacency[n])&&delete this.adjacency[n]}this.notify()},e.prototype.merge=function(t){var e=[];t.nodes.forEach(function(t){e.push(this.addNode(new n(t.id,t.data)))},this),t.edges.forEach(function(t){var n=e[t.from],r=e[t.to],a=t.directed?a=t.type+"-"+n.id+"-"+r.id:n.ide.x&&(e.x=i.p.x),i.p.y>e.y&&(e.y=i.p.y)});var n=e.subtract(t).multiply(.07);return{bottomleft:t.subtract(n),topright:e.add(n)}};var o=t.Vector=function(t,e){this.x=t,this.y=e};o.random=function(){return new o(10*(Math.random()-.5),10*(Math.random()-.5))},o.prototype.add=function(t){return new o(this.x+t.x,this.y+t.y)},o.prototype.subtract=function(t){return new o(this.x-t.x,this.y-t.y)},o.prototype.multiply=function(t){return new o(this.x*t,this.y*t)},o.prototype.divide=function(t){return new o(this.x/t||0,this.y/t||0)},o.prototype.magnitude=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},o.prototype.normal=function(){return new o(-this.y,this.x)},o.prototype.normalise=function(){return this.divide(this.magnitude())},r.ForceDirected.Point=function(t,e){this.p=t,this.m=e,this.v=new o(0,0),this.a=new o(0,0)},r.ForceDirected.Point.prototype.applyForce=function(t){this.a=this.a.add(t.divide(this.m))},r.ForceDirected.Spring=function(t,e,n,i){this.point1=t,this.point2=e,this.length=n,this.k=i};var s=t.Renderer=function(t,e,n,i,r,a){this.layout=t,this.clear=e,this.drawEdge=n,this.drawNode=i,this.onRenderStop=r,this.onRenderStart=a,this.layout.graph.addGraphListener(this)};s.prototype.graphChanged=function(t){this.start()},s.prototype.start=function(t){var e=this;this.layout.start(function(){e.clear(),e.layout.eachEdge(function(t,n){e.drawEdge(t,n.point1.p,n.point2.p)}),e.layout.eachNode(function(t,n){e.drawNode(t,n.p)})},this.onRenderStop,this.onRenderStart)},s.prototype.stop=function(){this.layout.stop()},Array.prototype.forEach||(Array.prototype.forEach=function(t,e){var n,i;if(null==this)throw new TypeError(" this is null or not defined");var r=Object(this),a=r.length>>>0;if("[object Function]"!={}.toString.call(t))throw new TypeError(t+" is not a function");for(e&&(n=e),i=0;i1&&void 0!==arguments[1]?arguments[1]:[];n(this,t);var r=this;r.x=r.y=0,r.leftChild=r.rightChild=null,r.height=e||0,r.children=i},o={isHorizontal:!0,nodeSep:20,nodeSize:20,rankSep:200,subTreeSep:10};t.exports=function(t){function e(t){if(!t)return null;t.width=0,t.depth&&t.depth>c&&(c=t.depth);var n=t.children,i=n.length,r=new a(t.height,[]);return n.forEach(function(t,n){var a=e(t);r.children.push(a),0===n&&(r.leftChild=a),n===i-1&&(r.rightChild=a)}),r.originNode=t,r.isLeaf=t.isLeaf(),r}function n(t){if(t.isLeaf||0===t.children.length)t.drawingDepth=c;else{var e=t.children.map(function(t){return n(t)}),i=Math.min.apply(null,e);t.drawingDepth=i-1}return t.drawingDepth}function s(t){t.x=t.drawingDepth*u.rankSep,t.isLeaf?(t.y=0,h&&(t.y=h.y+h.height+u.nodeSep,t.originNode.parent!==h.originNode.parent&&(t.y+=u.subTreeSep)),h=t):(t.children.forEach(function(t){s(t)}),t.y=(t.leftChild.y+t.rightChild.y)/2)}var u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};u=r({},o,u);var c=0,h=void 0,l=e(t);return n(l),s(l),i(l,t,u.isHorizontal),t}},function(t,e){"use strict";function n(t,e,n){t.x+=n*t.depth,t.y=e?e.y+e.height:0}var i=20;t.exports=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i,r=null;t.eachNode(function(t){n(t,r,e),r=t})}},function(t,e){"use strict";t.exports=18},function(t,e){"use strict";t.exports={T:{x:.5,y:0},R:{x:1,y:.5},B:{x:.5,y:1},L:{x:0,y:.5},C:null}},function(t,e){"use strict";t.exports=["LR","RL","TB","BT","H","V"]},function(t,e){"use strict";t.exports=["LR","RL","H","L","R"]},function(t,e,n){"use strict";var i=n(1),r=n(7),a=function(t){i.mix(this,t),this._init()};i.extend(a,r),i.augment(a,{step:0,margin:0,valueField:"..value",_init:function(){var t=this.edges.slice(0);this.edges=t,t.map(function(t){t["..value"]=1}),this._initNode()},_calculateStep:function(){var t=this,e=t.nodes,n=t.stepField;if(i.isNull(e[0][n])){var r=e.filter(function(t){return 0===t.inEdges.length});0===r.length&&(r=[e[0]]),t._setNodesStep(r)}e.map(function(e){void 0===e.step&&(e.step=t.step,t.step=t.step+1,t._setNodesStep([e]))})},_setNodesStep:function(t){var e=this,n=e.step,r=e.stepField,a=t.filter(function(t){return i.isNull(t[r])});if(a.length>0){a.map(function(t){t[r]=n}),e.step=n+1;var o=e._getNextNodes(a);o.length>0&&e._setNodesStep(o)}},_getNextNodes:function(t){var e=this,n=e.targetField,r=e.stepField,a=[];return t.forEach(function(t){t.outEdges.length>0&&t.outEdges.forEach(function(o){var s=o[n];if(s!==t.id){var u=e._findObj(s);i.isNull(u[r])&&a.push(u)}})}),a},_calculateValue:function(){var t=this,e=t.nodes,n=t.valueField;e.map(function(t){t[n]=1})},_layoutByWeight:function(t){var e=t.length,n=1/e,i=this.y,r=this;t.map(function(t,e){t.x=(e+.5)*n,t.y=void 0===t.y?i:t.y,r.onNodeChange(t.id,{x:t.x,y:t.y})})},_layoutHighStep:function(t,e){var n=this,i=n.y,r=e===n.sourceField?n.targetField:n.sourceField;t.map(function(t){var a,o=n._getEdgeOfCurNode(t,r),s=0,u=0,c=e===n.sourceField?t.step-1:t.step+1;o.forEach(function(t){a=n._findObj(t[e]),a.step===c&&(u++,s+=a.x)}),t.x=s/u,t.y=void 0===t.y?i:t.y,n.onNodeChange(t.id,{x:t.x,y:t.y})})},_layoutNodes:function(t,e){var n=this;if(t.length>=2){var i;for(i=1;i=n)){var i=t.splice(e,1)[0];t.splice(n,0,i)}}},function(t,e){"use strict";t.exports=function(t,e,n){if(!(e<=n)){var i=t.splice(e,1)[0];t.splice(n-1,0,i)}}},function(t,e,n){"use strict";var i=n(19);t.exports=function(t){return i.indexOf(t)>-1}}])})},function(t,e,n){"use strict";var i=(n(1),"\t\n\v\f\r \xa0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029"),r=new RegExp("([a-z])["+i+",]*((-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?["+i+"]*,?["+i+"]*)+)","ig"),a=new RegExp("(-?\\d*\\.?\\d*(?:e[\\-+]?\\d+)?)["+i+"]*,?["+i+"]*","ig"),o=function(t){if(!t)return null;if(typeof t==typeof[])return t;var e={a:7,c:6,o:2,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,u:3,z:0},n=[];return String(t).replace(r,function(t,i,r){var o=[],s=i.toLowerCase();if(r.replace(a,function(t,e){e&&o.push(+e)}),"m"==s&&o.length>2&&(n.push([i].concat(o.splice(0,2))),s="l",i="m"==i?"l":"L"),"o"==s&&1==o.length&&n.push([i,o[0]]),"r"==s)n.push([i].concat(o));else for(;o.length>=e[s]&&(n.push([i].concat(o.splice(0,e[s]))),e[s]););}),n},s=function(t,e){for(var n=[],i=0,r=t.length;r-2*!e>i;i+=2){var a=[{x:+t[i-2],y:+t[i-1]},{x:+t[i],y:+t[i+1]},{x:+t[i+2],y:+t[i+3]},{x:+t[i+4],y:+t[i+5]}];e?i?r-4==i?a[3]={x:+t[0],y:+t[1]}:r-2==i&&(a[2]={x:+t[0],y:+t[1]},a[3]={x:+t[2],y:+t[3]}):a[0]={x:+t[r-2],y:+t[r-1]}:r-4==i?a[3]=a[2]:i||(a[0]={x:+t[i],y:+t[i+1]}),n.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return n},u=function(t,e,n,i,r){if(null==r&&null==i&&(i=n),t=+t,e=+e,n=+n,i=+i,null!=r)var a=Math.PI/180,o=t+n*Math.cos(-i*a),s=t+n*Math.cos(-r*a),u=e+n*Math.sin(-i*a),c=e+n*Math.sin(-r*a),h=[["M",o,u],["A",n,n,0,+(r-i>180),0,s,c]];else h=[["M",t,e],["m",0,-i],["a",n,i,0,1,1,0,2*i],["a",n,i,0,1,1,0,-2*i],["z"]];return h},c=function(t){if(t=o(t),!t||!t.length)return[["M",0,0]];var e,n=[],i=0,r=0,a=0,c=0,h=0;"M"==t[0][0]&&(i=+t[0][1],r=+t[0][2],a=i,c=r,h++,n[0]=["M",i,r]);for(var l,f,d=3==t.length&&"M"==t[0][0]&&"R"==t[1][0].toUpperCase()&&"Z"==t[2][0].toUpperCase(),g=h,p=t.length;g1&&(y=Math.sqrt(y),n*=y,i*=y);var m=n*n,w=i*i,b=(a==o?-1:1)*Math.sqrt(Math.abs((m*w-m*x*x-w*v*v)/(m*x*x+w*v*v))),_=b*n*x/i+(t+s)/2,M=b*-i*v/n+(e+u)/2,S=Math.asin(((e-M)/i).toFixed(9)),A=Math.asin(((u-M)/i).toFixed(9));S=t<_?Math.PI-S:S,A=s<_?Math.PI-A:A,S<0&&(S=2*Math.PI+S),A<0&&(A=2*Math.PI+A),o&&S>A&&(S-=2*Math.PI),!o&&A>S&&(A-=2*Math.PI)}var P=A-S;if(Math.abs(P)>l){var E=A,T=s,C=u;A=S+l*(o&&A>S?1:-1),s=_+n*Math.cos(A),u=M+i*Math.sin(A),g=f(s,u,n,i,r,0,o,T,C,[A,E,_,M])}P=A-S;var I=Math.cos(S),k=Math.sin(S),B=Math.cos(A),O=Math.sin(A),F=Math.tan(P/4),N=4/3*n*F,z=4/3*i*F,j=[t,e],D=[t+N*k,e-z*I],R=[s+N*O,u-z*B],G=[s,u];if(D[0]=2*j[0]-D[0],D[1]=2*j[1]-D[1],c)return[D,R,G].concat(g);g=[D,R,G].concat(g).join().split(",");for(var Y=[],X=0,H=g.length;X7){t[e].shift();for(var r=t[e];r.length;)d[e]="A",i&&(g[e]="A"),t.splice(e++,0,["C"].concat(r.splice(0,6)));t.splice(e,1),y=Math.max(n.length,i&&i.length||0)}},u=function(t,e,r,a,o){t&&e&&"M"==t[o][0]&&"M"!=e[o][0]&&(e.splice(o,0,["M",a.x,a.y]),r.bx=0,r.by=0,r.x=t[o][1],r.y=t[o][2],y=Math.max(n.length,i&&i.length||0))},d=[],g=[],p="",v="",x=0,y=Math.max(n.length,i&&i.length||0);xn&&(r=2*Math.PI-t+e,a=t-n):(r=t-e,a=n-t),r>a?n:e}function a(t,e,n,i){var a=0;return n-e>=2*Math.PI&&(a=2*Math.PI),e=c.mod(e,2*Math.PI),n=c.mod(n,2*Math.PI)+a,t=c.mod(t,2*Math.PI),i?e>=n?t>n&&tn?t:r(t,e,n):e<=n?ee||tt.x&&(p=t.x),vt.y&&(x=t.y),y=0&&f=0?[r]:[]}var o=n(2).Vector2,s=n(8);t.exports={at:i,projectPoint:function(t,e,n,i,a,o,s,u){var c={};return r(t,e,n,i,a,o,s,u,c),c},pointDistance:r,extrema:a}},function(t,e,n){"use strict";t.exports={ScaleIn:n(121),ScaleOut:n(122),Update:n(123),Util:n(24)}},function(t,e,n){"use strict";var i=n(7),r={scaleIn:function(t,e,n,r,a){r=r?r:e,a=a?a:n,t.transform([["t",-r,-a],["s",.01,.01],["t",e,n]]),t.animate({transform:[["t",-e,-n],["s",100,100],["t",r,a]]},i.enterDuration,i.enterEasing)},scaleOut:function(t,e,n){t.animate({transform:[["t",-e,-n],["s",.01,.01],["t",e,n]]},i.leaveDuration,i.leaveEasing,function(){t.remove()})}};t.exports=r},function(t,e,n){"use strict";var i=n(1),r=n(10).G,a=r.Group,o=function t(e){t.superclass.constructor.call(this,e)};i.extend(o,a),i.augment(o,{init:function(){o.superclass.init.call(this),this.set("gid",this.get("id"))},addShape:function(t,e){var n=this.get("id"),i=o.superclass.addShape.call(this,t,e);return i.set("id",n),i.set("gid",n+"-"+this.get("children").length),i},addGroup:function(t,e){var n=this.get("id"),i=o.superclass.addGroup.call(this,t,e);return i.set("id",n),i.set("gid",n+this.get("children").length),i}}),t.exports=o},function(t,e,n){"use strict";var i=n(4),r=n(12),a=n(139),o=n(27),s=n(23),u=n(60),c=n(7),h=s.ScaleIn,l=s.ScaleOut,f=function t(e){t.superclass.constructor.call(this,e),this._init()};f.ATTRS={id:"",type:null,model:{},mapper:null,group:null,controlGroup:null,keyShape:null,class:null,drawFrameObj:{}},i.extend(f,r),i.mixin(f,[a,o]),i.augment(f,{_init:function(){var t=this,e=t.get("type"),n=u.getShape(e);this.set("shapeManger",n)},_calculateBBox:function(){var t=this,e=t.getKeyShape(),n=e.get("parent"),r=i.getBBox(e,n);return this.set("boxStash",r),r},getBBox:function(){var t=this.get("boxStash");return t||this._calculateBBox()},getKeyShape:function(){var t=this,e=t.get("group"),n=e.get("children"),i=t.get("keyShape");return i||n[0]},getModel:function(){this.get("model")},getShapeObj:function(){return this.get("shapeObj")},getShapeCfg:function(){return this.get("group").get("shapeCfg")},update:function(){var t=this,e=t.get("group");e.clear(),t.draw();var n=t.get("controlGroup");n&&(n.clear(),t._showBox(n),t._showControlPoints(n))},draw:function(){var t,e,n,r,a=this,o=a.get("model"),s=a.get("mapper"),u=s.mapping(o),c=a.get("group"),h=a.get("shapeManger");if(c.set("shapeCfg",u),a.beforeDraw(),t=u.shape,i.isArray(u.shape)&&(t=u.shape[0]),t&&t.startsWith&&t.startsWith("http")){if(!u.size)return e=new Image,n=a.getCanvas(),e.src=u.shape,void(e.onload=function(){return!(!a||a.get("destroyed"))&&(o.size=[e.width,e.height],a.draw(),void n.draw())});t="image"}r=h.draw(t,u,c),a.set("shapeObj",h.getShape(t)),a.set("keyShape",r),a._setAnimate(),a.afterDraw()},_setAnimate:function(){var t=this.get("group"),e=this.getShapeObj(),n=this.get("graph");if(n){var r=i.mix(!0,{},{enterAnimate:h,leaveAnimate:l},{enterAnimate:n.enterAnimate,leaveAnimate:n.leaveAnimate},{enterAnimate:e.enterAnimate,leaveAnimate:e.leaveAnimate});t.set("enterAnimate",r.enterAnimate),t.set("leaveAnimate",r.leaveAnimate)}},getCanvas:function(){var t=this.get("group").get("canvas");return t},beforeDraw:function(){},afterDraw:function(){var t=this.getShapeObj();this._calculateBBox(),t&&t.class&&this.set("class",t.class)},destroyItem:function(){},destroy:function(){var t=this,e=t.get("group");e&&e.remove();var n=t.get("controlGroup");n&&n.remove(),t.destroyItem(),f.superclass.destroy.call(this)},setActiveStatus:function(t){var e=this,n=e.get("controlGroup");if(n&&n.remove(!0),t){var i=e.get("frontCanvasRootGroup");n=i.addGroup({zIndex:c.zIndex.controlPoint}),e._showBox(n),e._showControlPoints(n),e.set("controlGroup",n)}else e.set("controlGroup",null)},_showBox:function(){},_show:function(){var t=this.get("group");t.show()},_hide:function(){var t=this.get("group");t.hide(),this.clearActived()},_showControlPoints:function(t){var e,n=this,r=n.getControlPoints(),a=n.get("type"),o=c[a+"ControlPointStyle"];o&&(e=o.r?o.r:5,i.each(r,function(r,a){t.addShape("rect",{class:"control-point",freezePoint:r,pointIndex:a,point:r,item:n,attrs:i.mix({},o,{x:r.x-e,y:r.y-e,width:2*e,height:2*e})})}))},showDelegation:function(t){var e,n=this.getDelegationPath(t),r=this.get("delegateEl"),a=t.stroke,o=i.mix(!0,{},c.delegationStyle,{path:n,stroke:a});r?r.attr(o):(e=this.get("frontCanvasRootGroup"),r=e.addShape("path",{attrs:o,capture:!1,zIndex:c.zIndex.delegate}),this.set("delegateEl",r))},getControlPoints:function(){},getDelegationPath:function(){},hideDelegation:function(){var t=this,e=t.get("delegateEl");e&&e.remove(),t.set("delegateEl",null)}}),t.exports=f},function(t,e,n){"use strict";var i=n(1),r=function(){};i.augment(r,{hasClass:function(t){var e=this.get("class");return!(!e||e.indexOf(t)===-1)}}),t.exports=r},function(t,e,n){"use strict";function i(t,e,n){return n?t.getShape(n):t.getShape(e)}var r=n(1),a={},o={defaultShapeType:null,getShape:function(t){var e=this,n=e[t]||e[e.defaultShapeType]||a.ShapeBase;return n},draw:function(t,e,n){var i,a=this.getShape(t),o=a.style(e);return o&&(r.isObject(e.style)?e.style=r.mix({},o,e.style):e.style=o),i=a.draw(e,n),a.afterDraw(e,n,i), +i}},s={afterDraw:function(){},draw:function(){},style:function(){}};a.registGeom=function(t,e){var n=r.ucfirst(t),i=r.mix({},o,e);return a[n]=i,i.className=n,i},a.registNode=function(t,e,n){var o=a.Node,s=i(o,t,n),u=r.mix({},s,e);return o[t]=u,u},a.registEdge=function(t,e,n){var o=a.Edge,s=i(o,t,n),u=r.mix({},s,e);return o[t]=u,u},a.getShape=function(t){var e=this;return t=r.ucfirst(t),e[t]||a.ShapeBase},a.GeomShape=o,a.ShapeBase=s,t.exports=a},function(t,e,n){"use strict";var i=n(1),r={};i.mix(r,{frameDraw:function(t,e){function n(){t.animateHandler=i.requestAnimationFrame(function(){t.animateHandler=void 0,t.toDraw&&n()}),e(),t.toDraw=!1}t.animateHandler?t.toDraw=!0:n()},drawLabel:function(t,e,n){return t.addShape("text",{attrs:e,class:"label",zIndex:n,freezePoint:{x:e.x,y:e.y}})}}),t.exports=r},function(t,e,n){"use strict";var i=n(1),r=n(8),a=n(2),o=a.Vector2,s=a.Vector3,u=2,c=.001;i.mix(r,{getpointInRectQuadrant:function(t,e){var n=new o(t.maxX-t.minX,t.minY-t.maxY),i=new o(t.maxX-t.minX,t.maxY-t.minY),a=new o(t.minX-t.maxX,t.maxY-t.minY),s=new o(t.minX-t.maxX,t.minY-t.maxY),u=new o(e.x-(t.minX+t.maxX)/2,e.y-(t.minY+t.maxY)/2);return r.getVectorAngle(u,i)=e&&t<=n},applyPoints:function(t,e,n){var a=[];return i.each(t,function(t){a.push(r.applyPoint(t,e,n))}),a},applyPoint:function(t,e,n){var i=new s(t.x,t.y,1);return e.apply(i,n),t.x=i.x,t.y=i.y,t},getBBox:function(t,e){e=e?e:t;var n,i,a,o,s,u=t.getBBox(),c=r.applyPoint({x:u.minX,y:u.minY},t,e),h=r.applyPoint({x:u.maxX,y:u.maxY},t,e);return n=c.x,i=c.y,a=h.x,o=h.y,s={minX:n,minY:i,x:n,y:i,maxX:a,maxY:o,centerX:(a+n)/2,centerY:(o+i)/2,width:a-n,height:o-i}},radixSort:function(t){var e,n,i,r,a,o,s,u=10,c=1,h=[],l=1;for(i=0;il&&(l=n);for(i=0;ic*l*f){var g=(a.x*s.y-a.y*s.x)/u,p=(a.x*o.y-a.y*o.x)/u;r.isBetween(g,0,1)&&r.isBetween(p,0,1)&&(d={x:t.x+g*o.x,y:t.y+g*o.y})}return d},getSnapPoint:function(t,e){for(var n=r.distance(t[0],e,!1),i=t[0],a=1;ae&&t.yn},isInSegment:function(t,e,n){if(!t||!e||!n)return!1;var i=r.segmentDistance(t,e,n);return i!==1/0&&i0?1:0,u=u-Math.PI/2>0?1:0,s===u)return 1/0;var c=o.angle(i),h=o.length();return Math.abs(h*Math.sin(c))},vector:function(t,e){return new o(e.x-t.x,e.y-t.y)},guid:function(){return"xxxxxxxx".replace(/[xy]/g,function(t){var e=16*Math.random()|0,n="x"===t?e:3&e|8;return n.toString(16)})}}),t.exports=r},function(t,e,n){"use strict";var i=n(3),r=function(t,e){var n,i,r,a,o,s=t.get("rootGroup");t._on("mousedown",function(t){e&&(t.shape||t.frontEvObj.shape)||(n={x:t.domX,y:t.domY},i=s.getMatrix())}),t._on("dragmove",function(e){n&&(a=e.domX-n.x,o=e.domY-n.y,r=i.clone(),r.translate(a,o),t.updateMatrix(r),t.draw(!1))}),t._on("dommouseleave",function(){n=void 0,i=void 0,a=void 0,o=void 0,r=void 0}),t._on("mouseup",function(){n=void 0,i=void 0,a=void 0,o=void 0,r=void 0})};i.dragCanvas=r,t.exports=r},function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n=1?t:-1*(Math.sqrt(1-(t/=1)*t)-1)},easeOutCirc:function(t){return 1*Math.sqrt(1-(t=t/1-1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var e=1.70158,n=0,i=1;return 0===t?0:1==(t/=1)?1:(n||(n=.3),i=1?1:n,o=d(n),e=i.getFrame(o,l,f,g,s),e.attrs&&s.attr(e.attrs),e.matrix&&s.setMatrix(e.matrix),this.ratio=n,this.currentFrame=e,this.updateStatus(),s},updateStatus:function(){var t=this.ratio,e=this.callBack,n=this.destroyTarget,i=this.target,r=this.repeat;if(t>=1)if(r){var a=this.startTime,o=this.endTime,s=this.duration;this.startTime=a+s,this.endTime=o+s,this.reset()}else this.needsDestroy=!0,e&&e.call(i),n&&!i.get("destroyed")&&i.remove(!0)},reset:function(){var t=this.target,e=this.startKeyFrame;e.attrs&&t.attr(e.attrs),e.matrix&&t.setMatrix(e.matrix),this.ratio=0,this.needsDestroy=!1},destroy:function(){var t=this.target,e=this.endKeyFrame;t&&!t.get("destroyed")&&(e.attrs&&t.attr(e.attrs),e.matrix&&t.setMatrix(e.matrix)),this.destroyed=!0}}),t.exports=o},function(t,e){"use strict";function n(){var t=document.createElement("i");return t.title="Web Colour Picker",t.style.display="none",document.body.appendChild(t),t}var i=/rgb\((\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,r={},a=null;t.exports={toRGB:function(t){a||(a=n());var e;if(r[t])e=r[t];else{a.style.color=t,e=document.defaultView.getComputedStyle(a,"").getPropertyValue("color");var o=i.exec(e);o.shift(),e=this.arr2rgb(o),r[t]=e}return e},toHex:function(t){return t=Math.round(t),t=t.toString(16),1===t.length&&(t="0"+t),t},hsl2Rgb:function(t){var e=t[0],n=t[1],i=t[2],r={};if(0===n)r.r=r.g=r.b=i;else{var a=function(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},o=i<=.5?i*(1+n):i+n-i*n,s=2*i-o;r.r=a(s,o,e+1/3),r.g=a(s,o,e),r.b=a(s,o,e-1/3)}return r.r=Math.min(Math.round(255*r.r),255),r.g=Math.min(Math.round(255*r.g),255),r.b=Math.min(Math.round(255*r.b),255),"#"+this.toHex(r.r)+this.toHex(r.g)+this.toHex(r.b)},rgb2hsl:function(t){var e,n,i,r=this.rgb2arr(t),a=r[0]/255,o=r[1]/255,s=r[2]/255,u=Math.min(a,o,s),c=Math.max(a,o,s),h=c-u;return c===u?e=0:a===c?e=(o-s)/h:o===c?e=2+(s-a)/h:s===c&&(e=4+(a-o)/h),e=Math.min(60*e,360),e<0&&(e+=360),i=(u+c)/2,n=c===u?0:i<=.5?h/(c+u):h/(2-c-u),[e/360,n,i]},arr2rgb:function(t){return"#"+this.toHex(t[0])+this.toHex(t[1])+this.toHex(t[2])},rgb2arr:function(t){var e=[];return e.push(parseInt(t.substr(1,2),16)),e.push(parseInt(t.substr(3,2),16)),e.push(parseInt(t.substr(5,2),16)),e}}},function(t,e){t.exports={prefix:"g",backupContext:document.createElement("canvas").getContext("2d"),debug:!1,warn:function(){}}},function(t,e,n){var i=n(1),r=n(115),a=n(116),o=n(114),s=n(40),u=n(111),c=["fillStyle","font","globalAlpha","lineCap","lineWidth","lineJoin","miterLimit","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","strokeStyle","textAlign","textBaseline","lineDash"],h=function(t){this.__cfg={zIndex:0,capture:!0,visible:!0,destroyed:!1},i.simpleMix(this.__cfg,this.getDefaultCfg(),t),this.initAttrs(this.__cfg.attrs),this.initTransform(),this.initEventDispatcher(),this.init()};h.CFG={id:null,zIndex:0,canvas:null,parent:null,capture:!0,context:null,visible:!0,destroyed:!1},i.augment(h,r,u,a,o,{init:function(){this.setSilent("animable",!0);var t=this.__attrs;t&&t.rotate&&this.rotateAtStart(t.rotate)},getParent:function(){return this.get("parent")},getDefaultCfg:function(){return{}},set:function(t,e){var n="__set"+i.ucfirst(t);return this[n]&&(e=this[n](e)),this.__cfg[t]=e,this},setSilent:function(t,e){this.__cfg[t]=e},get:function(t){return this.__cfg[t]},draw:function(t){this.get("destroyed")||this.get("visible")&&(this.setContext(t),this.drawInner(t),this.restoreContext(t))},setContext:function(t){var e=this.__attrs.clip;t.save(),e&&(e.resetTransform(t),e.createPath(t),t.clip()),this.resetContext(t),this.resetTransform(t)},restoreContext:function(t){t.restore()},resetContext:function(t){var e=this.__attrs;if(!this.isGroup)for(var n in e)if(c.indexOf(n)>-1){var r=e[n];"fillStyle"===n&&(r=s.parseStyle(r,this)),"strokeStyle"===n&&(r=s.parseStyle(r,this)),"lineDash"===n&&t.setLineDash?i.isArray(r)?t.setLineDash(r):i.isString(r)&&t.setLineDash(r.split(" ")):t[n]=r}},drawInner:function(){},show:function(){return this.set("visible",!0),this},hide:function(){return this.set("visible",!1),this},remove:function(t){if(void 0===t&&(t=!0),this.get("parent")){var e=this.get("parent"),n=e.get("children");i.remove(n,this)}return t&&this.destroy(),this},destroy:function(){var t=this.get("destroyed");t||(this.__cfg={},this.__attrs=null,this.__listeners=null,this.__m=null,this.set("destroyed",!0))},__setZIndex:function(t){return this.__cfg.zIndex=t,i.notNull(this.get("parent"))&&this.get("parent").sort(),t},__setAttrs:function(t){return this.attr(t),t},clone:function(){return i.clone(this)},getBBox:function(){return{minX:0,maxX:0,minY:0,maxY:0}}}),t.exports=h},function(t,e,n){function i(t,e){if(void 0===e)return t;t=new h(t),t.multiplyA(e);var n=t.getType();return"hsl"===n?t.getHSLStyle():"rgb"===n?t.getRGBStyle():void 0}function r(t,e,n){var r=t.match(v);u.each(r,function(t){t=t.split(":");var r=i(t[1],n);e.addColorStop(t[0],r)})}function a(t,e,n){var i,a,o=d.exec(t),s=c.mod(c.degreeToRad(parseFloat(o[1])),2*Math.PI),u=o[2],h=e.getBBox();s>=0&&s<.5*Math.PI?(i={x:h.minX,y:h.minY},a={x:h.maxX,y:h.maxY}):.5*Math.PI<=s&&s1){var i=e[0].charAt(0);e.splice(1,0,e[0].substr(1)),e[0]=i}u.each(e,function(t,n){isNaN(t)||(e[n]=+t)}),t[n]=e}),t):void 0},parseStyle:function(t,e,n){if(u.isString(t)){if("("===t[1]||"("===t[2]){if("l"===t[0])return a(t,e,n);if("r"===t[0])return o(t,e,n);if("p"===t[0])return s(t,e)}return u.isNull(n)?t:i(t,n)}},numberToColor:function(t){var e=x[t];if(!e){for(var n=t.toString(16),i=n.length;i<6;i++)n="0"+n;e="#"+n,x[t]=e}return e}}},function(t,e,n){var i=n(38),r={Group:n(113),Shape:n(5),Rect:n(55),Circle:n(43),Ellipse:n(45),Path:n(51),Text:n(56),Line:n(49),Image:n(47),Polygon:n(52),Polyline:n(53),Arc:n(42),Fan:n(46),Cubic:n(44),Quadratic:n(54),Marker:n(50),debug:function(t){i.debug=t}};t.exports=r},function(t,e,n){var i=n(1),r=n(2).Vector2,a=n(5),o=n(6),s=n(20),u=n(13),c=function(t){c.superclass.constructor.call(this,t)};c.ATTRS={x:0,y:0,r:0,startAngle:0,endAngle:0,clockwise:!1,lineWidth:1,arrow:!1},i.extend(c,a),i.augment(c,{canStroke:!0,type:"arc",getDefaultAttrs:function(){return{x:0,y:0,r:0,startAngle:0,endAngle:0,clockwise:!1,lineWidth:1,arrow:!1}},calculateBox:function(){var t=this.__attrs,e=t.x,n=t.y,i=t.r,r=t.startAngle,a=t.endAngle,o=t.clockwise,u=t.lineWidth,c=u/2,h=s.box(e,n,i,r,a,o);return h.minX-=c,h.minY-=c,h.maxX+=c,h.maxY+=c,h},isPointInPath:function(t,e){var n=this.__attrs,i=n.x,r=n.y,a=n.r,s=n.startAngle,u=n.endAngle,c=n.clockwise,h=n.lineWidth;return!!this.hasStroke()&&o.arcline(i,r,a,s,u,c,h,t,e)},createPath:function(t){var e=this.__attrs,n=e.x,i=e.y,a=e.r,o=e.startAngle,s=e.endAngle,c=e.clockwise,h=e.lineWidth,l=e.arrow;if(t=t||self.get("context"),t.beginPath(),t.arc(n,i,a,o,s,c),l){var f={x:n+a*Math.cos(s),y:i+a*Math.sin(s)},d=new r(-a*Math.sin(s),a*Math.cos(s));c&&d.multiplyScaler(-1),u.makeArrow(t,d,f,h)}}}),t.exports=c},function(t,e,n){var i=n(1),r=n(5),a=n(6),o=function(t){o.superclass.constructor.call(this,t)};o.ATTRS={x:0,y:0,r:0,lineWidth:1},i.extend(o,r),i.augment(o,{canFill:!0,canStroke:!0,type:"circle",getDefaultAttrs:function(){return{lineWidth:1}},calculateBox:function(){var t=this.__attrs,e=t.x,n=t.y,i=t.r,r=t.lineWidth,a=r/2+i;return{minX:e-a,minY:n-a,maxX:e+a,maxY:n+a}},isPointInPath:function(t,e){var n=this.hasFill(),i=this.hasStroke();return n&&i?this.__isPointInFill(t,e)||this.__isPointInStroke(t,e):n?this.__isPointInFill(t,e):!!i&&this.__isPointInStroke(t,e)},__isPointInFill:function(t,e){var n=this.__attrs,i=n.x,r=n.y,o=n.r;return a.circle(i,r,o,t,e)},__isPointInStroke:function(t,e){var n=this.__attrs,i=n.x,r=n.y,o=n.r,s=n.lineWidth;return a.arcline(i,r,o,0,2*Math.PI,!1,s,t,e)},createPath:function(t){var e=this.__attrs,n=e.x,i=e.y,r=e.r;t=t||self.get("context"),t.beginPath(),t.arc(n,i,r,0,2*Math.PI,!1)}}),t.exports=o},function(t,e,n){var i=n(1),r=n(5),a=n(6),o=n(13),s=n(16),u=n(2).Vector2,c=function(t){c.superclass.constructor.call(this,t)};c.ATTRS={p1:null,p2:null,p3:null,p4:null,lineWidth:1,arrow:!1},i.extend(c,r),i.augment(c,{canStroke:!0,type:"cubic",getDefaultAttrs:function(){return{lineWidth:1}},calculateBox:function(){var t,e,n=this.__attrs,r=n.p1,a=n.p2,o=n.p3,u=n.p4;if(i.isNull(r)||i.isNull(a)||i.isNull(o)||i.isNull(u))return null;var c=n.lineWidth/2,h=s.extrema(r[0],a[0],o[0],u[0]);for(t=0,e=h.length;tc?o:c,l=o>c?1:o/c,f=o>c?c/o:1,d=new u(t,e,1),g=new s;g.scale(l,f),g.translate(i,r);var p=g.getInverse();return d.applyMatrix(p),a.circle(0,0,h,d.x,d.y)},__isPointInStroke:function(t,e){var n=this.__attrs,i=n.x,r=n.y,o=n.rx,c=n.ry,h=n.lineWidth,l=o>c?o:c,f=o>c?1:o/c,d=o>c?c/o:1,g=new u(t,e,1),p=new s;p.scale(f,d),p.translate(i,r);var v=p.getInverse();return g.applyMatrix(v),a.arcline(0,0,l,0,2*Math.PI,!1,h,g.x,g.y)},createPath:function(t){var e=this.__attrs,n=e.x,i=e.y,r=e.rx,a=e.ry;t=t||self.get("context");var o=r>a?r:a,u=r>a?1:r/a,c=r>a?a/r:1,h=new s;h.scale(u,c),h.translate(n,i);var l=h.to2DObject();t.beginPath(),t.save(),t.transform(l.a,l.b,l.c,l.d,l.e,l.f),t.arc(0,0,o,0,2*Math.PI),t.restore(),t.closePath()}}),t.exports=c},function(t,e,n){var i=n(1),r=n(5),a=n(6),o=n(8),s=n(20),u=n(2),c=u.Vector2,h=function(t){h.superclass.constructor.call(this,t)};h.ATTRS={x:0,y:0,rs:0,re:0,startAngle:0,endAngle:0,clockwise:!1,lineWidth:1},i.extend(h,r),i.augment(h,{canFill:!0,canStroke:!0,type:"fan",getDefaultAttrs:function(){return{clockwise:!1,lineWidth:1,rs:0,re:0}},calculateBox:function(){var t=this,e=t.__attrs,n=e.x,i=e.y,r=e.rs,a=e.re,o=e.startAngle,u=e.endAngle,c=e.clockwise,h=e.lineWidth,l=s.box(n,i,r,o,u,c),f=s.box(n,i,a,o,u,c),d=Math.min(l.minX,f.minX),g=Math.min(l.minY,f.minY),p=Math.max(l.maxX,f.maxX),v=Math.max(l.maxY,f.maxY),x=h/2;return{minX:d-x,minY:g-x,maxX:p+x,maxY:v+x}},isPointInPath:function(t,e){var n=this.hasFill(),i=this.hasStroke();return n&&i?this.__isPointInFill(t,e)||this.__isPointInStroke(t,e):n?this.__isPointInFill(t,e):!!i&&this.__isPointInStroke(t,e)},__isPointInFill:function(t,e){var n=this.__attrs,i=n.x,r=n.y,a=n.rs,u=n.re,h=n.startAngle,l=n.endAngle,f=n.clockwise,d=new c(1,0),g=new c(t-i,e-r),p=d.angleTo(g),v=s.nearAngle(p,h,l,f);if(o.equal(p,v)){var x=g.lengthSq();if(a*a<=x&&x<=u*u)return!0}return!1},__isPointInStroke:function(t,e){var n=this.__attrs,i=n.x,r=n.y,o=n.rs,s=n.re,u=n.startAngle,c=n.endAngle,h=n.clockwise,l=n.lineWidth,f={x:Math.cos(u)*o+i,y:Math.sin(u)*o+r},d={x:Math.cos(u)*s+i,y:Math.sin(u)*s+r},g={x:Math.cos(c)*o+i,y:Math.sin(c)*o+r},p={x:Math.cos(c)*s+i,y:Math.sin(c)*s+r};return!!a.line(f.x,f.y,d.x,d.y,l,t,e)||(!!a.line(g.x,g.y,p.x,p.y,l,t,e)||(!!a.arcline(i,r,o,u,c,h,l,t,e)||!!a.arcline(i,r,s,u,c,h,l,t,e)))},createPath:function(t){var e=this.__attrs,n=e.x,i=e.y,r=e.rs,a=e.re,o=e.startAngle,s=e.endAngle,u=e.clockwise,c={x:Math.cos(o)*r+n,y:Math.sin(o)*r+i},h={x:Math.cos(o)*a+n,y:Math.sin(o)*a+i},l={x:Math.cos(s)*r+n,y:Math.sin(s)*r+i};t=t||self.get("context"),t.beginPath(),t.moveTo(c.x,c.y),t.lineTo(h.x,h.y),t.arc(n,i,a,o,s,u),t.lineTo(l.x,l.y),t.arc(n,i,r,s,o,!u),t.closePath()}}),t.exports=h},function(t,e,n){var i=n(1),r=n(5),a=n(6),o=function(t){o.superclass.constructor.call(this,t)};o.ATTRS={x:0,y:0,img:void 0,width:0,height:0,sx:null,sy:null,swidth:null,sheight:null},i.extend(o,r),i.augment(o,{type:"image",__afterSetAttrImg:function(t){this.__setAttrImg(t)},__afterSetAttrAll:function(t){t.img&&this.__setAttrImg(t.img)},isHitBox:function(){return!1},calculateBox:function(){var t=this.__attrs,e=t.x,n=t.y,i=t.width,r=t.height;return{minX:e,minY:n,maxX:e+i,maxY:n+r}},isPointInPath:function(t,e){var n=this.__attrs;if(this.get("toDraw")||!n.img)return!1;var i=n.x,r=n.y,o=n.width,s=n.height;return a.rect(i,r,o,s,t,e)},__setLoading:function(t){var e=this.get("canvas");return t===!1&&this.get("toDraw")===!0&&(this.__cfg.loading=!1,e.draw()),t},__setAttrImg:function(t){var e=this,n=e.__attrs;if(!i.isString(t))return t instanceof Image?(n.width||e.attr("width",t.width),n.height||e.attr("height",t.height),t):t instanceof HTMLElement&&i.isString(t.nodeName)&&"CANVAS"===t.nodeName.toUpperCase()?(n.width||e.attr("width",Number(t.getAttribute("width"))),n.height||e.attr("height",Number(t.getAttribute("height"))),t):t instanceof ImageData?(n.width||e.attr("width",t.width),n.height||e.attr("height",t.height),t):null;var r=new Image;r.onload=function(){if(e.get("destroyed"))return!1;e.attr("imgSrc",t),e.attr("img",r);var n=e.get("callback");n&&n.call(e),e.set("loading",!1)},r.src=t,e.set("loading",!0)},drawInner:function(t){return this.get("loading")?void this.set("toDraw",!0):void this.__drawImage(t)},__drawImage:function(t){var e=this.__attrs,n=e.x,r=e.y,a=e.img,o=e.width,s=e.height,u=e.sx,c=e.sy,h=e.swidth,l=e.sheight;if(this.set("toDraw",!1),a instanceof Image||a instanceof HTMLElement&&i.isString(a.nodeName)&&"CANVAS"===a.nodeName.toUpperCase()){if(i.isNull(u)||i.isNull(c)||i.isNull(h)||i.isNull(l))return void t.drawImage(a,n,r,o,s);if(i.notNull(u)&&i.notNull(c)&&i.notNull(h)&&i.notNull(l))return void t.drawImage(a,u,c,h,l,n,r,o,s)}else if(a instanceof ImageData)return void t.putImageData(a,n,r,u||0,c||0,h||o,l||s)}}),t.exports=o},function(t,e,n){var i={Rect:n(55),Circle:n(43),Ellipse:n(45),Path:n(51),Text:n(56),Line:n(49),Image:n(47),Polygon:n(52),Polyline:n(53),Arc:n(42),Fan:n(46),Cubic:n(44),Quadratic:n(54),Marker:n(50)};t.exports=i},function(t,e,n){var i=n(1),r=n(5),a=n(6),o=n(13),s=n(21),u=n(2),c=u.Vector2,h=function(t){h.superclass.constructor.call(this,t)};h.ATTRS={x1:0,y1:0,x2:0,y2:0,lineWidth:1,arrow:!1},i.extend(h,r),i.augment(h,{canStroke:!0,type:"line",getDefaultAttrs:function(){return{lineWidth:1,arrow:!1}},calculateBox:function(){var t=this.__attrs,e=t.x1,n=t.y1,i=t.x2,r=t.y2,a=t.lineWidth;return s.box(e,n,i,r,a)},isPointInPath:function(t,e){var n=this.__attrs,i=n.x1,r=n.y1,o=n.x2,s=n.y2,u=n.lineWidth;return!!this.hasStroke()&&a.line(i,r,o,s,u,t,e)},createPath:function(t){var e=this.__attrs,n=e.x1,i=e.y1,r=e.x2,a=e.y2,s=e.arrow,u=e.lineWidth;if(t=t||self.get("context"),t.beginPath(),t.moveTo(n,i),s){var h=new c(r-n,a-i),l=o.getEndPoint(h,new c(r,a),u);t.lineTo(l.x,l.y),o.makeArrow(t,h,l,u)}else t.lineTo(r,a)},getPoint:function(t){var e=this.__attrs;return{x:s.at(e.x1,e.x2,t),y:s.at(e.y1,e.y2,t)}}}),t.exports=h},function(t,e,n){var i=n(1),r=n(5),a=n(6),o=function(t){o.superclass.constructor.call(this,t)};o.Symbols={circle:function(t,e,n,i){i.arc(t,e,n,0,2*Math.PI,!1)},square:function(t,e,n,i){i.moveTo(t-n,e-n),i.lineTo(t+n,e-n),i.lineTo(t+n,e+n),i.lineTo(t-n,e+n),i.closePath()},diamond:function(t,e,n,i){i.moveTo(t-n,e),i.lineTo(t,e-n),i.lineTo(t+n,e),i.lineTo(t,e+n),i.closePath()},triangle:function(t,e,n,i){var r=n/.966,a=n;i.moveTo(t,e-n),i.lineTo(t+r,e+a),i.lineTo(t-r,e+a),i.closePath()},"triangle-down":function(t,e,n,i){var r=n/.966,a=n;i.moveTo(t,e+n),i.lineTo(t+r,e-a),i.lineTo(t-r,e-a),i.closePath()}},o.ATTRS={path:null,lineWidth:1},i.extend(o,r),i.augment(o,{type:"marker",canFill:!0,canStroke:!0,getDefaultAttrs:function(){return{x:0,y:0,lineWidth:1}},calculateBox:function(){var t=this.__attrs,e=t.x,n=t.y,i=t.radius,r=t.lineWidth,a=r/2+i;return{minX:e-a,minY:n-a,maxX:e+a,maxY:n+a}},isPointInPath:function(t,e){var n=this.__attrs,i=n.x,r=n.y,o=n.radius;return a.circle(i,r,o,t,e)},createPath:function(t){var e,n=this.__attrs,r=n.x,a=n.y,s=n.radius,u=n.symbol||"circle";e=i.isFunction(u)?u:o.Symbols[u],t.beginPath(),e(r,a,s,t)}}),t.exports=o},function(t,e,n){var i=n(1),r=n(5),a=n(118),o=n(40),s=n(13),u=n(19),c=n(16),h=n(2),l=h.Vector2,f=function(t){f.superclass.constructor.call(this,t)};f.ATTRS={path:null,lineWidth:1,curve:null,tCache:null},i.extend(f,r),i.augment(f,{canFill:!0,canStroke:!0,type:"path",getDefaultAttrs:function(){return{lineWidth:1}},__afterSetAttrPath:function(t){var e=this;if(i.isNull(t))return e.setSilent("segments",null),void e.setSilent("box",void 0);var n,r=o.parsePath(t),s=[];if(i.isArray(r)&&0!==r.length&&("M"===r[0][0]||"m"===r[0][0])){for(var u=r.length,c=0;cs&&(s=e.maxX),e.minYc&&(c=e.maxY))}),{minX:o,minY:u,maxX:s,maxY: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");if(i)return n.createPath(),i.isPointInPath(t,e)},__isPointInStroke:function(t,e){var n=this,i=n.get("segments"),r=n.__attrs,a=r.lineWidth,o=r.lineAppendWidth||0;a+=o;for(var s=0,u=i.length;s=e[0]&&t<=e[1]&&(n=(t-e[0])/(e[1]-e[0]),r=i)}),a=e[r],i.isNull(a)||i.isNull(r)?null:(o=a.length,s=e[r+1],{x:c.at(a[o-2],s[1],s[3],s[5],1-n),y:c.at(a[o-1],s[2],s[4],s[6],1-n)})):e?{x:e[0][1],y:e[0][2]}:null},createPath:function(t){var e=this,n=e.__attrs,r=e.get("segments"),a=n.lineWidth,o=n.arrow;if(i.isArray(r)){t=t||e.get("context"),t.beginPath();for(var u=0,c=r.length;us&&(s=e),nu&&(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(5),a=n(6),o=n(13),s=n(21),u=n(2),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];es&&(s=e),nu&&(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=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(5),a=n(6),o=n(13),s=n(22),u=n(2).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;t1){var i=this.__getSpaceingY();return n*e+i*(e-1)}return n},__afterSetAttrAll:function(t){var e=this;("fontSize"in t||"fontWeight"in t||"fontStyle"in t||"fontVariant"in t||"fontFamily"in t)&&e.__assembleFont(),"text"in t&&e.__afterSetAttrText(t.text)},isHitBox:function(){return!1},calculateBox:function(){var t=this,e=t.__attrs,n=e.x,i=e.y,r=t.measureText();if(!r)return{minX:n,minY:i,maxX:n,maxY:i};var a=t.__getTextHeight(),o=e.textAlign,s=e.textBaseline,u=e.lineWidth,c={x:n,y:i-a};o&&("end"===o||"right"===o?c.x-=r:"center"===o&&(c.x-=r/2)),s&&("top"===s?c.y+=a:"middle"===s&&(c.y+=a/2)),this.set("startPoint",c);var h=u/2;return{minX:c.x-h,minY:c.y-h,maxX:c.x+r+h,maxY:c.y+a+h}},__getSpaceingY:function(){var t=this.__attrs,e=t.lineHeight,n=1*t.fontSize;return e?e-n:.14*n},isPointInPath:function(t,e){var n=this,i=n.getBBox();if(n.hasFill()||n.hasStroke())return a.box(i.minX,i.maxX,i.minY,i.maxY,t,e)},drawInner:function(t){var e=this,n=e.__attrs,r=n.text;if(r){var a,o=n.textArr,s=1*n.fontSize,u=e.__getSpaceingY(),c=n.x,h=n.y,l=n.textBaseline;if(o){var f=e.getBBox();a=f.maxY-f.minY}var d;if(t.beginPath(),e.hasFill()){var g=n.fillOpacity;i.isNull(g)||1===g||(t.globalAlpha=g),o?i.each(o,function(e,n){d=h+n*(u+s)-a+s,"middle"===l&&(d+=a-s-(a-s)/2),"top"===l&&(d+=a-s),t.fillText(e,c,d)}):t.fillText(r,c,h)}e.hasStroke()&&(o?i.each(o,function(e,n){d=h+n*(u+s)-a+s,"middle"===l&&(d+=a-s-(a-s)/2),"top"===l&&(d+=a-s),t.strokeText(e,c,d)}):t.strokeText(r,c,h))}},measureText:function(){var t,e=this,n=e.__attrs,r=n.text,a=n.font,s=n.textArr,u=0;if(!i.isNull(r)){var c=o.backupContext;return c.save(),c.font=a,s?i.each(s,function(e){t=c.measureText(e).width,uMath.PI&&(n=2*Math.PI-n),n0?(t.updateItem(e,n),t.updateRollback(),t.clearAllActived(),t.setItemActived(e),t.draw(!1),t.endAdd(e)):(t.removeItem(e),t.refreshFront(),t.endAdd())}r.dragEdgeExtremePoint(t,e,n,i)}},function(t,e,n){"use strict";var i=n(3),r=n(31);i.dragBlank=function(t){r(t,!0)}},function(t,e,n){"use strict";var i=n(3),r=n(9),a=n(4);i.dragEdge=function(t){function e(e){var n,i=e.frontEvObj.shape;if(i&&"control-point"===i.get("class")&&(n=i.get("item"),t.isEdge(n)))return n}function n(t,e){var n,i=t.frontEvObj.shape;if(e&&(n=i.get("pointIndex"),e.isExtremePoint(n)))return n}function i(e,n){a.getObjectValues(n).length>0?(t.updateItem(e,n),t.updateRollback(),t.draw(!1)):t.refreshFront()}r.dragEdgeExtremePoint(t,e,n,i)}},function(t,e,n){"use strict";var i=n(3);i.dragHideEdges=function(t){var e=t.get("edgeGroup");t._on("dragstart",function(){e.hide(),t.draw(!1)}),t._on("dragend",function(){e.show(),t.draw(!1)}),t._on("dommouseleave",function(){e.show(),t.draw(!1)})}},function(t,e,n){"use strict";var i=n(3),r=n(9);i.dragHideTexts=function(t){t._on("dragstart",function(){r.hideTexts(t)}),t._on("dragend",function(){r.showTexts(t)}),t._on("dommouseleave",function(){r.showTexts(t)})}},function(t,e,n){"use strict";var i=n(1),r=n(3),a=n(9);r.dragNode=function(t){var e,n,r,o,s,u,c,h=t.get("gridAssist"),l=h&&h.forceAlign,f=[],d=null,g=!1;t._on("mousedown",function(a){r=a.frontEvObj.shape,n=a.item,t.isNode(n)&&!r&&(d={x:a.x,y:a.y},n.isActived()?(e=t._getAllActived(),i.each(e,function(t){f.push(t)})):f.push(n))}),t._on("dragmove",function(e){i.isArray(f)&&0!==f.length&&(g=!0,i.each(f,function(n){t.isNode(n)&&(c=n.getBBox(),u={x:(c.x+c.maxX)/2,y:(c.y+c.maxY)/2},n.showDelegation({x:u.x+e.x-d.x,y:u.y+e.y-d.y}))}),t.refreshFront())}),t._on("mouseup",function(r){return i.isArray(f)&&0!==f.length&&g?(1===f.length&&(t.clearAllActived(),t.setItemActived(f[0])),n=r.item,i.each(f,function(e){t.isNode(e)?(u=e.getPosition(),o={x:u.x+r.x-d.x,y:u.y+r.y-d.y},n!==e&&e&&!e.hasClass("preventToFront")&&t.toFront(e),l&&a.alignPoint(o,h.cell),e.hideDelegation()):(s=e.getControlPoints(),o={},s.length>2&&(i.each(s,function(t,e){0!==e&&e!==s.length-1&&(t.x=t.x+r.x-d.x,t.y=t.y+r.y-d.y,l&&a.alignPoint(t,h.cell))}),o={controlPoints:s})),t.updateItem(e,o)}),t.updateRollback(),t.draw(!1),d=null,n=void 0,u=void 0,s=void 0,e=void 0,o=void 0,g=!1,void(f=[])):void(f=[])})}},function(t,e,n){"use strict";var i=n(1),r=n(3),a=n(7),o=n(4);r.multiSelect=function(t){var e,n,r,s,u,c,h,l,f,d,g,p=t.get("frontCanvasRootGroup"),v=!1,x=[];t._on("mousedown",function(e){s=e.item,u=e.frontEvObj.shape,s||c||u||(h={x:e.x,y:e.y},c=p.addShape("rect",{attrs:a.frameRectStyle}),t.set("frameSelecting",!0))}),t._on("dragmove",function(e){c&&(l=Math.min(h.x,e.x),f=Math.min(h.y,e.y),d=Math.max(h.x,e.x),g=Math.max(h.y,e.y),c.attr({x:l,y:f,width:d-l,height:g-f}),t.refreshFront())}),t._on("mouseup",function(){c&&(e=t.get("itemCache"),i.each(e,function(e){n=e.getBBox(),r=[{x:n.x,y:n.y},{x:n.x,y:n.maxY},{x:n.maxX,y:n.y},{x:n.maxX,y:n.maxY}],i.each(r,function(n,i){if(v=o.isInRect(n,l,f,d,g),t.isNode(e)){if(v)return x.push(e),!1}else{if(!v)return!1;i===r.length-1&&x.push(e)}})}),t.clearAllActived(),t.setItemsActived(x),c.remove(!0),t.refreshFront(),t.set("frameSelecting",!1),s=void 0,c=void 0,h=void 0,l=void 0,f=void 0,d=void 0,g=void 0,x=[])})}},function(t,e,n){"use strict";var i=n(3),r=n(9),a=n(4);i.resizeEdge=function(t){var e,n,i,o,s,u,c,h,l,f,d,g,p=t.get("gridAssist"),v=p&&p.forceAlign;t._on("click",function(i){e=i.item,n=t.getActived(),g=i.frontEvObj.shape,t.isEdge(e)&&e===n&&!g&&(e.addControlPoint({x:i.x,y:i.y}),s=e.getControlPoints(),t.updateItem(e,{controlPoints:s}),t.updateRollback(),t.refreshFront())}),t._on("mousedown",function(e){if(g=e.frontEvObj.shape,g&&"control-point"===g.get("class")){if(i=g.get("item"),!t.isEdge(i))return void(i=void 0);if(f=g.get("pointIndex"),i.isExtremePoint(f))return i=void 0,void(f=void 0);o=g.get("point"),s=i.getControlPoints(),u=s[f-1],c=s[f+1]}}),t._on("dragmove",function(n){t.isEdge(i)&&(e=n.item,d={x:n.x,y:n.y,controlPointIndex:f},a.isInSegment(u,c,d)?d.stroke="red":d.stroke="blue",i.showDelegation(d),t.refreshFront())}),t._on("mouseup",function(x){t.isEdge(i)&&(e=x.item,g=x.frontEvObj.shape,h={x:x.x,y:x.y},l={},i.hideDelegation(),a.isInSegment(u,c,h)?s.splice(f,1):0!==f&&f!==s.length-1&&(o.x=h.x,o.y=h.y,v&&r.alignPoint(o,p.cell),l.controlPoints=s),t.updateItem(i,l),t.updateRollback(),t.draw(!1),e=void 0,n=void 0,i=void 0,o=void 0,s=void 0,u=void 0,c=void 0,h=void 0,l=void 0,f=void 0,d=void 0,g=void 0)})}},function(t,e,n){"use strict";var i=n(3),r=n(9);i.resizeNode=function(t){var e,n,i,a,o,s,u,c=!1;t._on("mousedown",function(t){e=t.frontEvObj.shape,e&&"control-point"===e.get("class")&&(o=e.get("item"),s=e.get("point"),u=e.get("pointIndex"))}),t._on("dragmove",function(h){t.isNode(o)&&(c=!0,e=h.frontEvObj.shape,n={x:h.x,y:h.y},a=r.getControlInfo(n,u,s,o,"frontCanvas"),i=a.size,i[0]>5&&i[1]>5&&(o.showDelegation(a),t.refreshFront()))}),t._on("mouseup",function(h){return t.isNode(o)&&c?(n={x:h.x,y:h.y},a=r.getControlInfo(n,u,s,o),i=a.size,i[0]>5&&i[1]>0&&(t.updateItem(o,a),t.updateRollback()),o.hideDelegation(),t.draw(!1),o=null,e=void 0,n=void 0,i=void 0,a=void 0,o=void 0,s=void 0,c=!1,void(u=void 0)):(o=void 0,void(c=!1))})}},function(t,e,n){"use strict";var i=n(3);i.shortcut=function(t){var e=!1;t._on("keydown",function(n){if(32===n.keyCode){if(e)return;e=!0,"drag"===t.get("mode")?t.changeMode("edit"):t.changeMode("drag"),e=!0}return n.metaKey&&67===n.keyCode?void t.copy():n.metaKey&&86===n.keyCode?void t.paste():n.metaKey&&n.altKey&&90===n.keyCode?void t.redo():n.metaKey&&90===n.keyCode?void t.updo():n.ctrlKey&&67===n.keyCode?void t.copy():n.ctrlKey&&86===n.keyCode?void t.paste():n.ctrlKey&&n.altKey&&90===n.keyCode?void t.redo():n.ctrlKey&&90===n.keyCode?void t.updo():8===n.keyCode?void t.del():void 0}),t._on("keyup",function(){e=!1})}},function(t,e,n){"use strict";var i=n(3);i.spreadout=function(t){t._on("click",function(e){var n=e.shape;n&&n.hasClass("spreadoutButton")&&(t.fire("spreadout",e),t.css({cursor:"default"}))}),t._on("spreadout",function(e){var n=t.get("dataMap"),i=e.item,r=i.get("id");n[r].isCollapsed=!1,t.clearAllActived(),t.refreshFront(),t.reRender()})}},function(t,e,n){"use strict";var i=n(3),r=n(4);i.wheelZoom=function(t){var e,n,i,a,o=1,s=1.05,u=t.get("rootGroup"),c=u.get("canvas"),h=setTimeout(function(){},100);t._on("mousewheel",function(l){e=l.originEvent,e.preventDefault(),n=e.wheelDelta,Math.abs(n)>10&&(i=c.getPointByClient(e.clientX,e.clientY),i={x:i.x/c.get("pixelRatio"),y:i.y/c.get("pixelRatio")},a=u.getMatrix().clone(),n>0?(o*=s,r.scaleMatrix(s,i,a),t.updateMatrix(a)):(o/=s,r.scaleMatrix(1/s,i,a),t.updateMatrix(a)),t.draw(!1),t.fire("wheelzoom",r.mix({scale:a.elements[0]},l)),clearTimeout(h),h=setTimeout(function(){t.draw(!1)},100))})}},function(t,e,n){"use strict";var i=n(3),r=n(9);i.wheelZoomHideEdges=function(t){var e=t.get("edgeGroup");r.wheelZoomHide(t,function(){e.hide(),t.draw(!1)},function(){e.show(),t.draw(!1)})}},function(t,e,n){"use strict";var i=n(3),r=n(9);i.wheelZoomHideTexts=function(t){r.wheelZoomHide(t,function(){r.hideTexts(t)},function(){r.showTexts(t)})}},function(t,e,n){"use strict";var i=n(11),r=n(3),a=n(154);a.Mode={default:["dragBlank","collapse","spreadout","buttonPointer","wheelZoom"]},i.registNode("tree-node",{style:function(){return{fillOpacity:1}}},"rect"),r.registMode(a),t.exports=a},function(t,e,n){"use strict";function i(){this.elements=[1,0,0,0,1,0,0,0,1]}var r=n(1),a=n(8);i.multiply=function(t,e){var n=t.elements,r=e.elements,a=new i;return a.set(n[0]*r[0]+n[3]*r[1]+n[6]*r[2],n[0]*r[3]+n[3]*r[4]+n[6]*r[5],n[0]*r[6]+n[3]*r[7]+n[6]*r[8],n[1]*r[0]+n[4]*r[1]+n[7]*r[2],n[1]*r[3]+n[4]*r[4]+n[7]*r[5],n[1]*r[6]+n[4]*r[7]+n[7]*r[8],n[2]*r[0]+n[5]*r[1]+n[8]*r[2],n[2]*r[3]+n[5]*r[4]+n[8]*r[5],n[2]*r[6]+n[5]*r[7]+n[8]*r[8])},i.equal=function(t,e){for(var n=t.elements,i=e.elements,r=!0,o=0,s=n.length;ot.x&&(this.x=t.x),this.y>t.y&&(this.y=t.y),this},max:function(t){return this.xe.x&&(this.x=e.x),this.ye.y&&(this.y=e.y),this},clampScale:function(){var t,e;return function(n,r){return void 0===t&&(t=new i,e=new i),t.set(n,n),e.set(r,r),this.clamp(t,e)}}(),floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(t){return this.x*t.x+this.y*t.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.lengthSq())},normalize:function(){return this.divideScaler(this.length())},distanceToSquared:function(t){var e=this.x-t.x,n=this.y-t.y;return e*e+n*n},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},angleTo:function(t,e){var n=this.angle(t),r=i.direction(this,t)>=0;return e?r?2*Math.PI-n:n:r?n:2*Math.PI-n},vertical:function(t){return t?new i(this.y,-this.x):new i(-this.y,this.x)},angle:function(t){return i.angle(this,t)},setLength:function(t){var e=this.length();return 0!==e&&t!==e&&this.multiplyScaler(t/e),this},isZero:function(){return 0===this.x&&0===this.y},lerp:function(t,e){return this.copy(i.lerp(this,t,e))},equal:function(t){return a.equal(this.x,t.x)&&a.equal(this.y,t.y)},clone:function(){return new i(this.x,this.y)},rotate:function(t){var e=this.x*Math.cos(t)-this.y*Math.sin(t),n=this.x*Math.sin(t)+this.y*Math.cos(t);return this.x=e,this.y=n,this}}),t.exports=i},function(t,e,n){"use strict";function i(t,e,n){if(1===arguments.length)if(r.isArray(t)){var i=t;t=i[0],e=i[1],n=i[2]}else if("vector2"===t.type){var a=t;t=a.x,e=a.y,n=1}this.x=t||0,this.y=e||0,this.z=n||0}var r=n(1),a=n(8);i.add=function(t,e){return new i(t.x+e.x,t.y+e.y,t.z+e.z)},i.sub=function(t,e){return new i(t.x-e.x,t.y-e.y,t.z-e.z)},i.lerp=function(t,e,n){return new i(t.x+(e.x-t.x)*n,t.y+(e.y-t.y)*n,t.z+(e.z-t.z)*n)},i.cross=function(t,e){var n=t.x,r=t.y,a=t.z,o=e.x,s=e.y,u=e.z;return new i(r*u-a*s,a*o-n*u,n*s-r*o)},i.angle=function(t,e){var n=t.dot(e)/(t.length()*e.length());return Math.acos(a.clamp(n,-1,1))},r.augment(i,{type:"vector3",set:function(t,e,n){return this.x=t,this.y=e,this.z=n,this},setComponent:function(t,e){switch(t){case 0:return this.x=e,this;case 1:return this.y=e,this;case 2:return this.z=e,this;default:throw new Error("index is out of range:"+t)}},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range:"+t)}},add:function(t){return this.copy(i.add(this,t))},sub:function(t){return this.copy(i.sub(this,t))},subBy:function(t){return this.copy(i.sub(t,this))},multiplyScaler:function(t){return this.x*=t,this.y*=t,this.z*=t,this},divideScaler:function(t){if(0!==t){var e=1/t;this.x*=e,this.y*=e,this.z*=e}else this.x=0,this.y=0,this.z=0;return this},min:function(t){return this.x>t.x&&(this.x=t.x),this.y>t.y&&(this.y=t.y),this.z>t.z&&(this.z=t.z),this},max:function(t){return this.xe.x&&(this.x=e.x),this.ye.y&&(this.y=e.y),this.ze.z&&(this.z=e.z),this},clampScale:function(){var t,e;return function(n,r){return void 0===t&&(t=new i,e=new i),t.set(n,n,n),e.set(r,r,r),this.clamp(t,e)}}(),floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.lengthSq())},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScaler(this.length())},setLength:function(t){var e=this.length();return 0!==e&&t!==e&&this.multiplyScaler(t/e),this},lerp:function(t,e){return this.copy(i.lerp(this,t,e))},cross:function(t){return this.copy(i.cross(this,t))},angle:function(t){return i.angle(this,t)},distanceToSquared:function(t){var e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},applyMatrix:function(t){var e=t.elements,n=e[0]*this.x+e[3]*this.y+e[6]*this.z,i=e[1]*this.x+e[4]*this.y+e[7]*this.z,r=e[2]*this.x+e[5]*this.y+e[8]*this.z;return this.x=n,this.y=i,this.z=r,this},copy:function(t){return this.x=t.x,this.y=t.y,this.z=void 0!==t.z?t.z:1,this},equal:function(t){return a.equal(this.x,t.x)&&a.equal(this.y,t.y)&&a.equal(this.z,t.z)},clone:function(){return new i(this.x,this.y,this.z)}}),t.exports=i},function(t,e,n){var i=n(86);t.exports=i},function(t,e,n){"use strict";var i=n(1),r=function(t,e,n,i){this.type=t,this.target=null,this.currentTarget=null,this.bubbles=n,this.cancelable=i,this.timeStamp=(new Date).getTime(),this.defaultPrevented=!1,this.propagationStopped=!1,this.removed=!1,this.event=e};i.augment(r,{preventDefault:function(){this.defaultPrevented=this.cancelable&&!0},stopPropagation:function(){this.propagationStopped=!0},remove:function(){this.remove=!0},clone:function(){return i.clone(this)},toString:function(){return"[Event (type="+this.type+")]"}}),t.exports=r},function(t,e,n){var i=n(90);t.exports={interpolation:i.interpolation,unInterpolation:i.unInterpolation}},function(t,e,n){"use strict";function i(t,e){for(var n=[],r=Math.min(t.length,e.length),s=0;s=1)return e.path;if(n<=0)return t.path;for(var o=0;o>16&255)/255,this.space.g=(t>>8&255)/255,this.space.b=(255&t)/255,this},setStyle:function(t){var e;if(e=u.hex.exec(t)){var n=e[1],i=n.length;if(3===i)return this.setRGB(parseInt(n.charAt(0)+n.charAt(0),16)/255,parseInt(n.charAt(1)+n.charAt(1),16)/255,parseInt(n.charAt(2)+n.charAt(2),16)/255),this;if(6===i)return this.setRGB(parseInt(n.charAt(0)+n.charAt(1),16)/255,parseInt(n.charAt(2)+n.charAt(3),16)/255,parseInt(n.charAt(4)+n.charAt(5),16)/255),this}else if(e=u.space.exec(t)){var r,a=e[1],o=e[2];switch(a){case"rgb":if(r=u.rgbNum.exec(o))return this.setRGB(parseInt(r[1],10)/255,parseInt(r[2],10)/255,parseInt(r[3],10)/255),this;if(r=u.rgbPre.exec(o))return this.setRGB(parseInt(r[1],10)/100,parseInt(r[2],10)/100,parseInt(r[3],10)/100),this;break;case"rgba":if(r=u.rgbaNum.exec(o))return this.setRGB(parseInt(r[1],10)/255,parseInt(r[2],10)/255,parseInt(r[3],10)/255,parseFloat(r[4])),this;if(r=u.rgbaPre.exec(o))return this.setRGB(parseInt(r[1],10)/100,parseInt(r[2],10)/100,parseInt(r[3],10)/100,parseFloat(r[4])),this;break;case"hsl":if(r=u.hsl.exec(o))return this.setHSL(parseInt(r[1],10)/360,parseInt(r[2],10)/100,parseInt(r[3],10)/100),this;break;case"hsla":if(r=u.hsla.exec(o))return this.setHSL(parseInt(r[1],10)/360,parseInt(r[2],10)/100,parseInt(r[3],10)/100,parseFloat(r[4])),this}}else t=t.toLowerCase(),void 0!==s[t]?this.setHex(s[t]):this.setHex(s.black)},copy:function(t){this.space=t.space.clone()},clone:function(){return new i(this)}}),t.exports=i},function(t,e){t.exports={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,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+(ie&&this.set("endTime",n)},_setCanvases:function(t){var e=t.canvas,n=this.get("canvases");n.indexOf(e)===-1&&n.push(e)},_resetTweens:function(){var t=this.get("tweens");t.sort(function(t,e){return e.get("startTime")-t.get("startTime")}),i.each(t,function(t){t.reset()})},_getTime:function(){var t=this.get("playTime"),e=this.get("pauseTimeSpace");return+new Date-t+e},_refresh:function(t){for(var e,n,r=this.get("tweens"),a=(this.get("canvases"),this.get("autoDraw")),o=[],s=[],u=0;u0&&(t=e._getTime(),e._refresh(t)),e.fire("update"),i.requestAnimationFrame(function(){e._update()})}},animate:function(t,e){var n=new a({target:t,timeline:this,startTime:e?e:0});return n},add:function(t){var e,n=this.get("tweens");return i.isArray(t)?e=n.concat(t):i.isObject(t)&&"tween"===t.type?(n.push(t),e=n):console.error("Timeline not Support this type"),this.set("tweens",e),this._trySetCanvases(t),this._trySetEndTime(t),this},getNow:function(){var t=this.get("playTime");return t?+new Date-t:0},getTime:function(){var t=this.get("playTime");return t?+new Date-t:0},play:function(){var t=this.get("status");return"silent"===t&&(this.set("playTime",+new Date),this.set("available",!0),this.set("status","playing"),this._update()),this},stop:function(){this.set("status","silent"),this.set("available",!1),this.set("pauseTimeSpace",0),this._resetTweens(),this._refresh(0),this.draw()},pause:function(){var t=this.get("available");return t&&this.set("pauseTimeSpace",+new Date-this.get("playTime")),this.set("available",!1),this.set("status","silent"),this},reset:function(){this.set("status","silent"),this.set("available",!1),this.set("pauseTimeSpace",0),this.set("playTime",0),this.set("endTime",0),this.set("tweens",[]),this.set("canvases",[])},draw:function(){for(var t,e=this.get("canvases"),n=0;n20&&(r=20),parseFloat(t.toFixed(r))}function r(t,e){for(var n in e)e.hasOwnProperty(n)&&"constructor"!==n&&void 0!==e[n]&&(t[n]=e[n])}var a=n(103);a.mix(a,{mixin:function(t,e){if(t&&e){t._mixins=e,t.ATTRS=t.ATTRS||{};var n={};a.each(e,function(e){a.augment(t,e);var i=e.ATTRS;i&&a.mix(n,i)}),t.ATTRS=a.mix(n,t.ATTRS)}},map:function(t,e){var n=[];return a.each(t,function(t,i){n.push(e(t,i))}),n},filter:function(t,e){var n=[];return a.each(t,function(t,i){e(t,i)&&n.push(t)}),n},guid:function(){var t={};return function(e){return e=e||"g",t[e]?t[e]+=1:t[e]=1,e+t[e]}}(),inArray:function(t,e){return a.indexOf(t,e)!==-1},indexOf:function(t,e){var n=Array.prototype.indexOf;if(n)return n.call(t,e);for(var i=-1,r=0;r=0;e--)delete t[e];t.length=0},equalsArray:function(t,e){if(t===e)return!0;if(!t||!e)return!1;if(t.length!==e.length)return!1;for(var n=!0,i=0;i=t[n-1])return t[n-1];for(var r=1;rt[n-1])return NaN;if(en?n:t},snapTo:function(t,e){var r=n(t,e),a=i(t,e);if(isNaN(r)||isNaN(a)){if(t[0]>=e)return t[0];var o=t[t.length-1];if(o<=e)return o}return Math.abs(e-r)2&&(n.push([i].concat(a.splice(0,2))),o="l",i="m"==i?"l":"L"),"o"==o&&1==a.length&&n.push([i,a[0]]),"r"==o)n.push([i].concat(a));else for(;a.length>=e[o]&&(n.push([i].concat(a.splice(0,e[o]))),e[o]););}),n},c=function(t,e){for(var n=[],i=0,r=t.length;r-2*!e>i;i+=2){var a=[{x:+t[i-2],y:+t[i-1]},{x:+t[i],y:+t[i+1]},{x:+t[i+2],y:+t[i+3]},{x:+t[i+4],y:+t[i+5]}];e?i?r-4==i?a[3]={x:+t[0],y:+t[1]}:r-2==i&&(a[2]={x:+t[0],y:+t[1]},a[3]={x:+t[2],y:+t[3]}):a[0]={x:+t[r-2],y:+t[r-1]}:r-4==i?a[3]=a[2]:i||(a[0]={x:+t[i],y:+t[i+1]}),n.push(["C",(-a[0].x+6*a[1].x+a[2].x)/6,(-a[0].y+6*a[1].y+a[2].y)/6,(a[1].x+6*a[2].x-a[3].x)/6,(a[1].y+6*a[2].y-a[3].y)/6,a[2].x,a[2].y])}return n},h=function(t,e,n,i,r){if(null==r&&null==i&&(i=n),t=+t,e=+e,n=+n,i=+i,null!=r)var a=Math.PI/180,o=t+n*Math.cos(-i*a),s=t+n*Math.cos(-r*a),u=e+n*Math.sin(-i*a),c=e+n*Math.sin(-r*a),h=[["M",o,u],["A",n,n,0,+(r-i>180),0,s,c]];else h=[["M",t,e],["m",0,-i],["a",n,i,0,1,1,0,2*i],["a",n,i,0,1,1,0,-2*i],["z"]];return h},l=function(t){if(t=u(t),!t||!t.length)return[["M",0,0]];var e,n=[],i=0,r=0,a=0,o=0,s=0;"M"==t[0][0]&&(i=+t[0][1],r=+t[0][2],a=i,o=r,s++,n[0]=["M",i,r]);for(var l,f,d=3==t.length&&"M"==t[0][0]&&"R"==t[1][0].toUpperCase()&&"Z"==t[2][0].toUpperCase(),g=s,p=t.length;g1&&(y=Math.sqrt(y),n*=y,i*=y);var m=n*n,w=i*i,b=(a==o?-1:1)*Math.sqrt(Math.abs((m*w-m*x*x-w*v*v)/(m*x*x+w*v*v))),_=b*n*x/i+(t+s)/2,M=b*-i*v/n+(e+u)/2,S=Math.asin(((e-M)/i).toFixed(9)),A=Math.asin(((u-M)/i).toFixed(9));S=t<_?Math.PI-S:S,A=s<_?Math.PI-A:A,S<0&&(S=2*Math.PI+S),A<0&&(A=2*Math.PI+A),o&&S>A&&(S-=2*Math.PI),!o&&A>S&&(A-=2*Math.PI)}var P=A-S;if(Math.abs(P)>l){var E=A,T=s,C=u;A=S+l*(o&&A>S?1:-1),s=_+n*Math.cos(A),u=M+i*Math.sin(A),d=g(s,u,n,i,r,0,o,T,C,[A,E,_,M])}P=A-S;var I=Math.cos(S),k=Math.sin(S),B=Math.cos(A),O=Math.sin(A),F=Math.tan(P/4),N=4/3*n*F,z=4/3*i*F,j=[t,e],D=[t+N*k,e-z*I],R=[s+N*O,u-z*B],G=[s,u];if(D[0]=2*j[0]-D[0],D[1]=2*j[1]-D[1],c)return[D,R,G].concat(d);d=[D,R,G].concat(d).join().split(",");for(var Y=[],X=0,H=d.length;X7){t[e].shift();for(var r=t[e];r.length;)c[e]="A",i&&(h[e]="A"),t.splice(e++,0,["C"].concat(r.splice(0,6)));t.splice(e,1),y=Math.max(n.length,i&&i.length||0)}},u=function(t,e,r,a,o){t&&e&&"M"==t[o][0]&&"M"!=e[o][0]&&(e.splice(o,0,["M",a.x,a.y]),r.bx=0,r.by=0,r.x=t[o][1],r.y=t[o][2],y=Math.max(n.length,i&&i.length||0))},c=[],h=[],p="",v="",x=0,y=Math.max(n.length,i&&i.length||0);x1?1:u<0?0:u;for(var c=u/2,h=12,l=[-.1252,.1252,-.3678,.3678,-.5873,.5873,-.7699,.7699,-.9041,.9041,-.9816,.9816],f=[.2491,.2491,.2335,.2335,.2032,.2032,.1601,.1601,.1069,.1069,.0472,.0472],d=0,g=0;gMath.max(r,o)||Math.max(e,i)Math.max(a,s))){var u=(t*i-e*n)*(r-o)-(t-n)*(r*s-a*o),c=(t*i-e*n)*(a-s)-(e-i)*(r*s-a*o),h=(t-n)*(a-s)-(e-i)*(r-o);if(h){var l=u/h,f=c/h,d=+l.toFixed(2),g=+f.toFixed(2);if(!(d<+Math.min(t,n).toFixed(2)||d>+Math.max(t,n).toFixed(2)||d<+Math.min(r,o).toFixed(2)||d>+Math.max(r,o).toFixed(2)||g<+Math.min(e,i).toFixed(2)||g>+Math.max(e,i).toFixed(2)||g<+Math.min(a,s).toFixed(2)||g>+Math.max(a,s).toFixed(2)))return{x:l,y:f}}}},M=function(t,e,n){return e>=t.x&&e<=t.x+t.width&&n>=t.y&&n<=t.y+t.height},S=function(t,e,n,i,r){if(r)return[["M",+t+ +r,e],["l",n-2*r,0],["a",r,r,0,0,1,r,r],["l",0,i-2*r],["a",r,r,0,0,1,-r,r],["l",2*r-n,0],["a",r,r,0,0,1,-r,-r],["l",0,2*r-i],["a",r,r,0,0,1,r,-r],["z"]];var a=[["M",t,e],["l",n,0],["l",0,i],["l",-n,0],["z"]];return a.toString=toString,a},v=function(t,e,n,i){return null==t&&(t=e=n=i=0),null==e&&(e=t.y,n=t.width,i=t.height,t=t.x),{x:t,y:e,width:n,w:n,height:i,h:i,x2:t+n,y2:e+i,cx:t+n/2,cy:e+i/2,r1:Math.min(n,i)/2,r2:Math.max(n,i)/2,r0:Math.sqrt(n*n+i*i)/2,path:S(t,e,n,i),vb:[t,e,n,i].join(" ")}},A=function(t,e){return t=v(t),e=v(e),M(e,t.x,t.y)||M(e,t.x2,t.y)||M(e,t.x,t.y2)||M(e,t.x2,t.y2)||M(t,e.x,e.y)||M(t,e.x2,e.y)||M(t,e.x,e.y2)||M(t,e.x2,e.y2)||(t.xe.x||e.xt.x)&&(t.ye.y||e.yt.y)},P=function(t,e,n,r,a,o,s,u){i.isArray(t)||(t=[t,e,n,r,a,o,s,u]);var c=b.apply(null,t);return v(c.min.x,c.min.y,c.max.x-c.min.x,c.max.y-c.min.y)},E=function(t,e,n,i,a,o,s,u,c){var h=1-c,l=Math.pow(h,3),f=Math.pow(h,2),d=c*c,g=d*c,p=l*t+3*f*c*n+3*h*c*c*a+g*s,v=l*e+3*f*c*i+3*h*c*c*o+g*u,x=t+2*c*(n-t)+d*(a-2*n+t),y=e+2*c*(i-e)+d*(o-2*i+e),m=n+2*c*(a-n)+d*(s-2*a+n),w=i+2*c*(o-i)+d*(u-2*o+i),b=h*t+c*n,_=h*e+c*i,M=h*a+c*s,S=h*o+c*u,A=90-180*Math.atan2(x-m,y-w)/r; +return{x:p,y:v,m:{x:x,y:y},n:{x:m,y:w},start:{x:b,y:_},end:{x:M,y:S},alpha:A}},T=function(t,e,n){var i=P(t),r=P(e);if(!A(i,r))return n?0:[];for(var a=w.apply(0,t),o=w.apply(0,e),s=~~(a/8),u=~~(o/8),c=[],h=[],l={},f=n?0:[],d=0;d=0&&T<=1&&C>=0&&C<=1&&(n?f++:f.push({x:S.x,y:S.y,t1:T,t2:C}))}}return f},C=function(t,e,n){t=p(t),e=p(e);for(var i,r,a,o,s,u,c,h,l,f,d=n?0:[],g=0,v=t.length;g');t.appendChild(n),this.set("canvasDOM",n)}},_setInitSize:function(){this.get("widthStyle")?this.changeSizeByCss(this.get("widthStyle"),this.get("heightStyle")):this.get("width")&&this.changeSize(this.get("width"),this.get("height"))},_getPx:function(t,e){var n=this.get("canvasDOM");n.style[t]=e;var r=i.getBoundingClientRect(n);return"width"===t?r.right-r.left:"height"===t?r.bottom-r.top:void 0},_reSize:function(){var t=this.get("canvasDOM"),e=this.get("widthCanvas"),n=this.get("heightCanvas"),i=this.get("widthStyle"),r=this.get("heightStyle");t.style.width=i,t.style.height=r,t.setAttribute("width",e),t.setAttribute("height",n)},getWidth:function(){var t=this.get("pixelRatio"),e=this.get("width");return e*t},getHeight:function(){var t=this.get("pixelRatio"),e=this.get("height");return e*t},changeSizeByCss:function(t,e){var n=this.get("pixelRatio");t=this._getPx("width",t),e=this._getPx("height",e);var i=t*n,r=e*n;this.set("widthStyle",t),this.set("heightStyle",e),this.set("widthCanvas",i),this.set("heightCanvas",r),this.set("width",t),this.set("height",e),this._reSize()},changeSize:function(t,e){var n=this.get("pixelRatio"),i=t*n,r=e*n;this.set("widthCanvas",i),this.set("heightCanvas",r),this.set("widthStyle",t+"px"),this.set("heightStyle",e+"px"),this.set("width",t),this.set("height",e),this._reSize()},getPointByClient:function(t,e){var n=this.get("el"),i=n.getBoundingClientRect(),r=i.right-i.left,a=i.bottom-i.top;return{x:(t-i.left)*(n.width/r),y:(e-i.top)*(n.height/a)}},getClientByPoint:function(t,e){var n=this.get("el"),i=n.getBoundingClientRect(),r=i.right-i.left,a=i.bottom-i.top;return{clientX:t/(n.width/r)+i.left,clientY:e/(n.height/a)+i.top}},beforeDraw:function(){var t=this.get("context"),e=this.get("el");t&&t.clearRect(0,0,e.width,e.height)},_beginDraw:function(){this.setSilent("toDraw",!0)},_endDraw:function(){this.setSilent("toDraw",!1)},draw:function(){function t(){e.set("animateHandler",i.requestAnimationFrame(function(){e.set("animateHandler",void 0),e.get("toDraw")&&t()})),e.beforeDraw();try{var n=e.get("context");o.superclass.draw.call(e,n)}catch(t){console.warn("error in draw canvas, detail as:"),console.warn(t),e._endDraw()}e._endDraw()}var e=this;e.get("destroyed")||(e.get("animateHandler")?this._beginDraw():t())},destroy:function(){var t=this.get("containerDOM"),e=this.get("canvasDOM");e&&t&&t.removeChild(e),o.superclass.destroy.call(this)}}),t.exports=o},function(t,e,n){"use strict";var i=n(1),r=function(t,e,n,i){this.type=t,this.target=null,this.currentTarget=null,this.bubbles=n,this.cancelable=i,this.timeStamp=(new Date).getTime(),this.defaultPrevented=!1,this.propagationStopped=!1,this.removed=!1,this.event=e};i.augment(r,{preventDefault:function(){this.defaultPrevented=this.cancelable&&!0},stopPropagation:function(){this.propagationStopped=!0},remove:function(){this.remove=!0},clone:function(){return i.clone(this)},toString:function(){return"[Event (type="+this.type+")]"}}),t.exports=r},function(t,e,n){var i=n(1),r=n(110);t.exports={initEventDispatcher:function(){this.__listeners={}},on:function(t,e){var n=this.__listeners;return i.isNull(n[t])&&(n[t]=[]),n[t].indexOf(e)===-1&&n[t].push(e),this},off:function(t,e){var n=this.__listeners;return 0===arguments.length?(this.__listeners={},this):1===arguments.length&&i.isString(t)?(n[t]=[],this):2===arguments.length&&i.isString(t)&&i.isFunction(e)?(i.remove(n[t],e),this):void 0},has:function(t,e){var n=this.__listeners;return 0===arguments.length&&!i.isBlank(n)||(!(1!==arguments.length||!n[t]||i.isBlank(n[t]))||!(2!==arguments.length||!n[t]||n[t].indexOf(e)===-1))},trigger:function(t){var e=this,n=e.__listeners,r=n[t.type];if(t.target=e,i.notNull(r)&&r.forEach(function(n){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(85),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(2).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.attrs){var o=e.attrs;if("text"===t){var s=i.get("fontFamily");s&&(o.fontFamily=o.fontFamily?o.fontFamily:s)}}return e.canvas=i,e.type=t,n=new u[r](e),this.add(n),n},addGroup:function(t,e){var n,i=this.get("canvas");if(e=a.mix({},e),a.isFunction(t))e?(e.canvas=i,e.parent=this,n=new t(e)):n=new t({canvas:i,parent:this}),this.add(n);else if(a.isObject(t))t.canvas=i,n=new h(t),this.add(n);else{if(void 0!==t)return!1;n=new h,this.add(n)}return n},renderBack:function(t,e){var n=this.get("backShape"),i=this.getBBox(),r=this.get("parent");return a.mix(e,{x:i.minX-t[3],y:i.minY-t[0],width:i.width+t[1]+t[3],height:i.height+t[0]+t[2]}),n?n.attr(e):n=r.addShape("rect",{zIndex:-1,attrs:e}),this.set("backShape",n),r.sort(),n},removeChild:function(t,e){if(arguments.length>=2)this.contain(t)&&t.remove(e);else{if(1===arguments.length){if(!a.isBoolean(t))return this.contain(t)&&t.remove(!0),this;e=t}0===arguments.length&&(e=!0),h.superclass.remove.call(this,e)}return this},add:function(t){var e=this,n=e.get("children");if(a.isArray(t))a.each(t,function(t){var n=t.get("parent");n&&n.removeChild(t,!1),e.__setEvn(t)}),n.push.apply(n,t);else{var i=t,r=i.get("parent");r&&r.removeChild(i,!1),e.__setEvn(i),n.push(i)}return e},contain:function(t){var e=this.get("children");return e.indexOf(t)>-1},getChildByIndex:function(t){var e=this.get("children");return e[t]},getFirst:function(){return this.getChildByIndex(0)},getLast:function(){var t=this.get("children").length-1;return this.getChildByIndex(t)},__setEvn:function(t){var e=this;t.__cfg.parent=e,t.__cfg.context=e.__cfg.context,t.__cfg.canvas=e.__cfg.canvas;var n=t.__attrs.clip;n&&(n.setSilent("parent",e),n.setSilent("context",e.get("context")));var i=t.__cfg.children;i&&a.each(i,function(e){t.__setEvn(e)})},getBBox:function(){var t=this,e=1/0,n=-(1/0),i=1/0,r=-(1/0),s=t.get("children");a.each(s,function(t){if(t.get("visible")){var a=t.getBBox();if(!a)return!0;var s=new o(a.minX,a.minY,1),u=new o(a.minX,a.maxY,1),c=new o(a.maxX,a.minY,1),h=new o(a.maxX,a.maxY,1);t.apply(s),t.apply(u),t.apply(c),t.apply(h);var l=Math.min(s.x,u.x,c.x,h.x),f=Math.max(s.x,u.x,c.x,h.x),d=Math.min(s.y,u.y,c.y,h.y),g=Math.max(s.y,u.y,c.y,h.y);ln&&(n=f),dr&&(r=g)}});var u={minX:e,minY:i,maxX:n,maxY:r};return u.x=u.minX,u.y=u.minY,u.width=u.maxX-u.minX,u.height=u.maxY-u.minY,u},drawInner:function(t){for(var e=this.get("children"),n=0;n-1?(null===t.get("canvas")&&(t=i.clone(t)),t.set("parent",e.get("parent")),t.set("context",e.get("context")),t.inside=function(n,i){var a=new r(n,i,1);return t.invert(a,e.get("canvas")),t.__isPointInFill(a.x,a.y)},t):null}}},function(t,e,n){function i(t){var e=t.elements;return 1===e[0]&&0===e[1]&&0===e[3]&&1===e[4]&&0===e[6]&&0===e[7]}function r(t){var e=t.elements;return 0===e[1]&&0===e[3]&&0===e[6]&&0===e[7]}function a(t,e){i(e)||(r(e)?(t.elements[0]*=e.elements[0],t.elements[4]*=e.elements[4]):t.multiply(e))}var o=n(1),s=n(2).Matrix3;t.exports={initTransform:function(){this.__m=new s},translate:function(t,e){return this.__m.translate(t,e),this.clearTotalMatrix(),this},rotate:function(t){return this.__m.rotate(t),this.clearTotalMatrix(),this},scale:function(t,e){return this.__m.scale(t,e),this.clearTotalMatrix(),this},rotateAtStart:function(t){var e=this.attr("x"),n=this.attr("y");Math.abs(t)>2*Math.PI&&(t=t/180*Math.PI),this.transform([["t",-e,-n],["r",t],["t",e,n]])},move:function(t,e){var n=this.get("x")||0,i=this.get("y")||0;this.translate(t-n,e-i),this.set("x",t),this.set("y",e)},transform:function(t){var e=this;return o.each(t,function(t){switch(t[0]){case"t":e.translate(t[1],t[2]);break;case"s":e.scale(t[1],t[2]);break;case"r":e.rotate(t[1]);break;case"m":e.__m=s.multiply(t[1],e.__m),e.clearTotalMatrix()}}),e},setTransform:function(t){return this.__m.identity(),this.transform(t)},getMatrix:function(){return this.__m},setMatrix:function(t){return this.__m=t,this.clearTotalMatrix(),this},apply:function(t,e){var n;return n=e?this._getMatrixByRoot(e):this.__m,t.applyMatrix(n),this},_getMatrixByRoot:function(t){var e=this;t=t||e;for(var n=e,i=[];n!==t;)i.unshift(n),n=n.get("parent");i.unshift(n);var r=new s;return o.each(i,function(t){r.multiply(t.__m)}),r},getTotalMatrix:function(){var t=this.__cfg.totalMatrix;if(!t){t=new s;var e=this.__cfg.parent;if(e){var n=e.getTotalMatrix();a(t,n)}a(t,this.__m),this.__cfg.totalMatrix=t}return t},clearTotalMatrix:function(){},invert:function(t){var e=this.getTotalMatrix();if(r(e))t.x/=e.elements[0],t.y/=e.elements[4];else{var n=e.getInverse();t.applyMatrix(n)}return this},resetTransform:function(t){var e=this.__m.to2DObject();i(this.__m)||t.transform(e.a,e.b,e.c,e.d,e.e,e.f)}}},function(t,e){t.exports={xAt:function(t,e,n,i,r){return e*Math.cos(t)*Math.cos(r)-n*Math.sin(t)*Math.sin(r)+i},yAt:function(t,e,n,i,r){return e*Math.sin(t)*Math.cos(r)+n*Math.cos(t)*Math.sin(r)+i},xExtrema:function(t,e,n){return Math.atan(-n/e*Math.tan(t))},yExtrema:function(t,e,n){return Math.atan(n/(e*Math.tan(t)))}}},function(t,e,n){function i(t,e,n){return{x:n.x+t,y:n.y+e}}function r(t,e){return{x:e.x+(e.x-t.x),y:e.y+(e.y-t.y)}}function a(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function o(t,e){return(t[0]*e[0]+t[1]*e[1])/(a(t)*a(e))}function s(t,e){return(t[0]*e[1]1&&(r*=Math.sqrt(x),a*=Math.sqrt(x));var y=Math.sqrt((r*r*(a*a)-r*r*(v*v)-a*a*(p*p))/(r*r*(v*v)+a*a*(p*p)));n===i&&(y*=-1),isNaN(y)&&(y=0);var m=y*r*v/a,w=y*-a*p/r,b=(l+d)/2+Math.cos(c)*m-Math.sin(c)*w,_=(f+g)/2+Math.sin(c)*m+Math.cos(c)*w,M=s([1,0],[(p-m)/r,(v-w)/a]),S=[(p-m)/r,(v-w)/a],A=[(-1*p-m)/r,(-1*v-w)/a],P=s(S,A);return o(S,A)<=-1&&(P=Math.PI),o(S,A)>=1&&(P=0),0===i&&P>0&&(P-=2*Math.PI),1===i&&P<0&&(P+=2*Math.PI),[t,b,_,r,a,M,P,c,i]}var c=n(1),h=n(8),l=n(6),f=n(16),d=n(22),g=n(117),p=n(2),v=p.Vector2,x=p.Vector3,y=p.Matrix3,m=["m","l","c","a","q","h","v","t","s","z"],w=function(t,e,n){this.preSegment=e,this.isLast=n,this.init(t,e)};c.augment(w,{init:function(t,e){var n=t[0];e=e||{endPoint:{x:0,y:0}};var a,o,s,c,h=m.indexOf(n)>=0,l=h?n.toUpperCase():n,f=t,d=e.endPoint,g=f[1],p=f[2];switch(l){default:break;case"M":c=h?i(g,p,d):{x:g,y:p},this.command="M",this.params=[d,c],this.subStart=c,this.endPoint=c;break;case"L":c=h?i(g,p,d):{x:g,y:p},this.command="L",this.params=[d,c],this.subStart=e.subStart,this.endPoint=c,this.isLast&&(this.endTangent=function(){return new v(c.x-d.x,c.y-d.y)});break;case"H":c=h?i(g,0,d):{x:g,y:d.y},this.command="L",this.params=[d,c],this.subStart=e.subStart,this.endPoint=c,this.endTangent=function(){return new v(c.x-d.x,c.y-d.y)};break;case"V":c=h?i(0,g,d):{x:d.x,y:g},this.command="L",this.params=[d,c],this.subStart=e.subStart,this.endPoint=c,this.endTangent=function(){return new v(c.x-d.x,c.y-d.y)};break;case"Q":h?(a=i(g,p,d),o=i(f[3],f[4],d)):(a={x:g,y:p},o={x:f[3],y:f[4]}),this.command="Q",this.params=[d,a,o],this.subStart=e.subStart,this.endPoint=o,this.endTangent=function(){return new v(o.x-a.x,o.y-a.y)};break;case"T":o=h?i(g,p,d):{x:g,y:p},"Q"===e.command?(a=r(e.params[1],d),this.command="Q",this.params=[d,a,o],this.subStart=e.subStart,this.endPoint=o,this.endTangent=function(){return new v(o.x-a.x,o.y-a.y)}):(this.command="TL",this.params=[d,o],this.subStart=e.subStart,this.endPoint=o,this.endTangent=function(){return new v(o.x-d.x,o.y-d.y)});break;case"C":h?(a=i(g,p,d),o=i(f[3],f[4],d),s=i(f[5],f[6],d)):(a={x:g,y:p},o={x:f[3],y:f[4]},s={x:f[5],y:f[6]}),this.command="C",this.params=[d,a,o,s],this.subStart=e.subStart,this.endPoint=s,this.endTangent=function(){return new v(s.x-o.x,s.y-o.y)};break;case"S":h?(o=i(g,p,d),s=i(f[3],f[4],d)):(o={x:g,y:p},s={x:f[3],y:f[4]}),"C"===e.command?(a=r(e.params[2],d),this.command="C",this.params=[d,a,o,s],this.subStart=e.subStart,this.endPoint=s,this.endTangent=function(){return new v(s.x-o.x,s.y-o.y)}):(this.command="SQ",this.params=[d,o,s],this.subStart=e.subStart,this.endPoint=s,this.endTangent=function(){return new v(s.x-o.x,s.y-o.y)});break;case"A":var x=g,y=p,w=f[3],b=f[4],_=f[5];c=h?i(f[6],f[7],d):{x:f[6],y:f[7]},this.command="A",this.params=u(d,c,b,_,x,y,w),this.subStart=e.subStart,this.endPoint=c;break;case"Z":this.command="Z",this.params=[d,e.subStart],this.subStart=e.subStart,this.endPoint=e.subStart}},isInside:function(t,e,n){var i=this,r=i.command,a=i.params,o=i.box;if(o&&!l.box(o.minX,o.maxX,o.minY,o.maxY,t,e))return!1;switch(r){default:break;case"M":return!1;case"TL":case"L":case"Z":return l.line(a[0].x,a[0].y,a[1].x,a[1].y,n,t,e);case"SQ":case"Q":return l.quadraticline(a[0].x,a[0].y,a[1].x,a[1].y,a[2].x,a[2].y,n,t,e);case"C":return l.cubicline(a[0].x,a[0].y,a[1].x,a[1].y,a[2].x,a[2].y,a[3].x,a[3].y,n,t,e);case"A":var s=a,u=s[1],c=s[2],h=s[3],f=s[4],d=s[5],g=s[6],p=s[7],v=s[8],m=h>f?h:f,w=h>f?1:h/f,b=h>f?f/h:1;s=new x(t,e,1);var _=new y;return _.translate(-u,-c),_.rotate(-p),_.scale(1/w,1/b),s.applyMatrix(_),l.arcline(0,0,m,d,d+g,1-v,n,s.x,s.y)}return!1},draw:function(t){var e,n,i,r=this.command,a=this.params;switch(r){default:break;case"M":t.moveTo(a[1].x,a[1].y);break;case"TL":case"L":t.lineTo(a[1].x,a[1].y);break;case"SQ":case"Q":e=a[1],n=a[2],t.quadraticCurveTo(e.x,e.y,n.x,n.y);break;case"C":e=a[1],n=a[2],i=a[3],t.bezierCurveTo(e.x,e.y,n.x,n.y,i.x,i.y);break;case"A":var o=a,s=o[1],u=o[2],c=s,h=u,l=o[3],f=o[4],d=o[5],g=o[6],p=o[7],v=o[8],x=l>f?l:f,y=l>f?1:l/f,m=l>f?f/l:1;t.translate(c,h),t.rotate(p),t.scale(y,m),t.arc(0,0,x,d,d+g,1-v),t.scale(1/y,1/m),t.rotate(-p),t.translate(-c,-h);break;case"Z":t.closePath()}},getBBox:function(t){var e,n,i,r,a=t/2,o=this.params;switch(this.command){default:case"M":case"Z":break;case"TL":case"L":this.box={minX:Math.min(o[0].x,o[1].x)-a,maxX:Math.max(o[0].x,o[1].x)+a,minY:Math.min(o[0].y,o[1].y)-a,maxY:Math.max(o[0].y,o[1].y)+a};break;case"SQ":case"Q":for(n=d.extrema(o[0].x,o[1].x,o[2].x),i=0,r=n.length;iM&&(M=P)}var E=g.yExtrema(x,h,l),T=1/0,C=-(1/0),I=[m,w];for(i=2*-Math.PI;i<=2*Math.PI;i+=Math.PI){var k=E+i;1===y?mC&&(C=B)}this.box={minX:_-a,maxX:M+a,minY:T-a,maxY:C+a}}}}),t.exports=w},function(t,e){var n=document.createElement("table"),i=document.createElement("tr"),r=/^\s*<(\w+|!)[^>]*>/,a={tr:document.createElement("tbody"),tbody:n,thead:n,tfoot:n,td:i,th:i,"*":document.createElement("div")};t.exports={getBoundingClientRect:function(t){var e=t.getBoundingClientRect(),n=document.documentElement.clientTop,i=document.documentElement.clientLeft;return{top:e.top-n,bottom:e.bottom-n,left:e.left-i,right:e.right-i}},getStyle:function(t,e){return window.getComputedStyle?window.getComputedStyle(t,null)[e]:t.currentStyle[e]},modiCSS:function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t.style[n]=e[n]);return t},createDom:function(t){var e=r.test(t)&&RegExp.$1;e in a||(e="*");var n=a[e];return t=t.replace(/(^\s*)|(\s*$)/g,""),n.innerHTML=""+t,n.childNodes[0]},addEventListener:function(t,e,n){return t.addEventListener?(t.addEventListener(e,n,!1),{remove:function(){t.removeEventListener(e,n,!1)}}):t.attachEvent?(t.attachEvent("on"+e,n),{remove:function(){t.detachEvent("on"+e,n)}}):void 0}}},function(t,e){t.exports={transform:function(t,e){t=t.clone();for(var n=0,i=e.length;ns?e:t,l={attrs0:{},attrs1:{}},f=!1;return a.each(c,function(s,u){n=t[u],i=e[u],a.isObject(n)||a.isObject(i)||"path"===u&&(r=a.isString(n)?n:a.pathToString(n),o=a.isString(i)?i:a.pathToString(i),r===o||r.indexOf("NaN")!==-1||o.indexOf("NaN")!==-1)||a.isArray(n)&&a.isArray(i)&&a.equalsArray(n,i)||n===i||h[u]||(l.attrs0[u]=n,l.attrs1[u]=i,f=!0)}),!!f&&l}function r(t,e,n){var i,o,s=e.get("children");return a.each(s,function(e){n++,o=e.get("gid"),e.isGroup&&(n=r(t,e,n)),o&&(t[o]={matrix:e.getMatrix().clone(),origin:e},i=e.get("shapeCfg"),i&&(t[o].enterAnimate=e.get("enterAnimate"),t[o].leaveAnimate=e.get("leaveAnimate"),t[o].model=i.origin),e.isShape&&(t[o].attrs=e.getAllAttrs()))}),n}var a=n(4),o=n(2),s=n(23),u=s.Update,c=o.Matrix3,h={text:"text",elements:"elements",rotate:"rotate",textAlign:"textAlign",textBaseline:"textBaseline",fontStyle:"fontStyle",font:"font",fontWeight:"fontWeight",fontFamily:"fontFamily"},l=function(t){a.mix(this,t)};a.augment(l,{canvas:null,map0:null,map1:null,run:function(){this.init(),this.count<5e3&&(this._compare(),this._addTween()),this.canvas.draw()},init:function(){var t=this.canvas,e=this.elementsStash,n={},i=0;e=e?e:{},i=r(n,t,i),this.elementsStash=n,this.map0=e,this.map1=n,this.count=i},_compare:function(){var t=this.map0,e=this.map1,n=[],i=[],r=[];a.each(e,function(e,i){t[i]?e.origin.get("type")===t[i].origin.get("type")&&r.push(i):n.push(i)}),a.each(t,function(t,n){e[n]||i.push(n)}),this.enterElements=n,this.leaveElements=i,this.updateElements=r},_addTween:function(){var t,e,n,r,o,s=this,h=this.enterElements,l=this.leaveElements,f=this.updateElements,d=this.map0,g=this.map1;a.each(h,function(t){o=g[t],o.enterAnimate&&o.enterAnimate(o.origin,d,g)}),a.each(l,function(t){r=d[t],r.leaveAnimate&&(r.origin.getParent().add(r.origin),r.leaveAnimate(r.origin,d,g))}),a.each(f,function(h){o=g[h],r=d[h],e=i(r.attrs,o.attrs),t=c.equal(r.matrix,o.matrix),n={},e&&(o.origin.attr(e.attrs0),a.mix(n,e.attrs1)),t||(o.origin.setMatrix(r.matrix),n.matrix=o.matrix),!e&&t||u(o.origin,n,s)})}}),t.exports=l},function(t,e,n){"use strict";function i(t,e,n){return t.addEventListener?(t.addEventListener(e,n,!1),{remove:function(){t.removeEventListener(e,n,!1)}}):t.attachEvent?(t.attachEvent("on"+e,n),{remove:function(){t.detachEvent("on"+e,n)}}):void 0}var r=n(4),a=function(t){r.mix(this,t),this.init()};r.augment(a,{graph:null,frontCanvas:null,canvas:null,currentItem:null,dragitem:null,rootGroup:null,lastEventObj:null,currentEventObj:null,el:null,init:function(){var t=this.graph;this.frontCanvas=t.get("frontCanvas"),this.canvas=t.get("canvas"),this._initEvent()},_initEvent:function(){var t=this,e=t.frontCanvas,n=e.get("el");this.el=n,this.domMouseLeave=i(n,"mouseleave",r.wrapBehavior(t,"onDomMouseLeave")),this.domMouseDown=i(n,"mousedown",r.wrapBehavior(t,"onMouseDown")),this.domMouseUp=i(n,"mouseup",r.wrapBehavior(t,"onMouseUp")),this.domMouseMove=i(n,"mousemove",r.wrapBehavior(t,"onMouseMove")),this.domDblClick=i(n,"dblclick",r.wrapBehavior(t,"onDblClick")),this.domMouseWheel=i(n,"mousewheel",r.wrapBehavior(t,"onMouseWheel")),this.domKeyDown=i(n,"keydown",r.wrapBehavior(t,"onKeyDown")),this.domKeyUp=i(n,"keyup",r.wrapBehavior(t,"onKeyUp")),this.domContextMenu=i(n,"contextmenu",r.wrapBehavior(t,"onContextMenu"))},_parsePoint:function(t,e){var n=this.canvas.get("pixelRatio"),i=this.graph,r={x:t/n,y:e/n};return i.invertPoint(r)},_getEventObj:function(t,e){var n,i=this.graph,r=t.clientX,a=t.clientY,o=e.getPointByClient(r,a),s=this._parsePoint(o.x,o.y),u=e.getShape(o.x,o.y),c=i.getItem(u);return c&&(n=c.get("type")),{item:c,itemType:n,shape:u,x:s.x,y:s.y,domX:t.offsetX,domY:t.offsetY,originEvent:t}},getEventObj:function(t){return{item:t.item,itemType:t.itemType,x:t.x,y:t.y,domX:t.domX,domY:t.domY,shape:t.shape,toEvObj:t.toEvObj,frontEvObj:t.frontEvObj,originEvent:t.originEvent}},_processEventObj:function(t){var e,n,i=this.canvas,a=this.frontCanvas,o=this.currentEventObj;o&&r.isObject(o)&&(this.lastEventObj=r.mix({},o)),e=this._getEventObj(t,i),n=this._getEventObj(t,a),e.frontEvObj=n,this.currentEventObj=e,this.currentItem=e.item},onDomMouseLeave:function(){this.graph.fire("dommouseleave")},onContextMenu:function(t){this._processEventObj(t);var e=this.currentEventObj;this.graph.fire("contextmenu",this.getEventObj(e))},onDblClick:function(t){this._processEventObj(t);var e=this.currentEventObj;this.graph.fire("dblclick",this.getEventObj(e))},onKeyUp:function(t){t.preventDefault(),this.graph.fire("keyup",t)},onKeyDown:function(t){t.preventDefault(),this.graph.fire("keydown",t); +},onMouseWheel:function(t){this._processEventObj(t);var e=this.currentEventObj;this.graph.fire("mousewheel",this.getEventObj(e))},onMouseDown:function(t){t.preventDefault(),this._processEventObj(t);var e=this.currentEventObj;this.pressing=!0,this.dragging=!0,this.pressingPoint={x:e.x,y:e.y},0===t.button&&this.graph.fire("mousedown",this.getEventObj(e))},onMouseUp:function(t){t.preventDefault(),this._processEventObj(t);var e=this.currentEventObj;0===t.button&&(this.pressing&&(this.graph.fire("click",this.getEventObj(e)),e.item&&this.graph.fire("itemclick",this.getEventObj(e)),this.pressing=!1),this.dragging&&(this.dragStartPoint&&this.graph.fire("dragend",this.getEventObj(e)),this.dragging=!1),this.graph.fire("mouseup",this.getEventObj(e)),this.dragStartPoint=null,this.dragItem=null)},onMouseMove:function(t){t.preventDefault(),this._processEventObj(t);var e=this.graph,n=this.currentEventObj,i=this.lastEventObj;this.pressing!==!0||n.x===i.x&&n.y===i.y||(this.pressing=!1),i&&n&&(i.toEvObj=n,n.fromEvObj=i,this.isSame(i,n,"shape")||((i.shape||i.frontEvObj.shape)&&e.fire("mouseleave",this.getEventObj(i)),(n.shape||n.frontEvObj.shape)&&e.fire("mouseenter",this.getEventObj(n))),this.isSame(i,n,"item")||((i.item||i.frontEvObj.item)&&e.fire("itemmouseleave",this.getEventObj(i)),(n.item||n.frontEvObj.item)&&e.fire("itemmouseenter",this.getEventObj(n)))),this.dragging&&(this.dragStartPoint?e.fire("dragmove",this.getEventObj(n)):(this.dragStartPoint={x:n.x,y:n.y},this.dragItem=n.item,e.fire("dragstart",this.getEventObj(n)))),n.item&&e.fire("itemhover",this.getEventObj(n)),e.fire("mousemove",this.getEventObj(n))},isSame:function(t,e,n){var i=t[n],r=e[n],a=t.frontEvObj[n],o=e.frontEvObj[n];return i===r&&a===o},destroy:function(){var t=this.domMouseUp,e=this.domMouseDown,n=this.domMouseMove,i=this.domDblClick,r=this.domMouseWheel,a=this.domContextMenu,o=this.domKeyDown,s=this.domKeyUp;a&&a.remove(),s&&s.remove(),r&&r.remove(),o&&o.remove(),i&&i.remove(),t&&t.remove(),e&&e.remove(),n&&n.remove()}}),t.exports=a},function(t,e,n){"use strict";var i=n(1),r=function(t){i.mix(this,t),this.init()};i.augment(r,{group:null,visible:!0,gridEl:null,minX:0,minY:0,cell:10,maxX:1e3,maxY:1e3,line:null,init:function(){var t=this,e=t.group,n=t._getPath(),r=i.mix({},t.line);r.path=n;var a=e.addShape("path",{attrs:r,capture:!1});a.set("visible",t.visible),this.gridEl=a},_getPath:function(){for(var t=this,e=t.minX,n=t.minY,i=t.maxX,r=t.maxY,a=t._getCell(),o=Math.ceil(e/a)*a,s=Math.ceil(n/a)*a,u=[],c=0;c<=i-e;c+=a){var h=o+c;u.push(["M",h,n]),u.push(["L",h,r])}for(var l=0;l<=r-n;l+=a){var f=s+l;u.push(["M",e,f]),u.push(["L",i,f])}return u},_getCell:function(){var t=this.cell?this.cell:10;return t},update:function(t){i.mix(this,t);var e=this._getPath(),n=this.gridEl;n.attr("path",e),n.set("visible",this.visible)},destroy:function(){var t=this,e=t.gridEl;e&&e.remove()}}),t.exports=r},function(t,e,n){"use strict";var i=n(4),r=n(25),a=function(t){i.mix(this,t),this.init()};i.augment(a,{graph:null,guides:[],frontGuideGroup:null,backGuideGroup:null,init:function(){var t=this.graph,e=t.get("frontGroup").addGroup(),n=t.get("backGroup").addGroup();this.frontGuideGroup=e,this.backGuideGroup=n},link:function(t){this.guides.push({type:"link",cfg:t})},_link:function(t){var e=this.guides,n=this.graph,a=n.find(t.source),o=n.find(t.target);if(!a||!o)return!1;var s=t.id?t.id:"guide-link-"+e.length,u=this.frontGuideGroup,c=u.addGroup(r,{data:{type:"link",cfg:t},id:s}),h=a.getCenter(),l=o.getCenter(),f=a.getIntersectionByPoint(l),d=o.getIntersectionByPoint(h),g=i.mix({},t,{source:a,target:o,points:[f,d]}),p=t.shape?t.shape:"line";return i.drawEdge(p,g,c),c},draw:function(){var t=this,e=this.guides;i.each(e,function(e){t["_"+e.type](e.cfg)})},save:function(){return this.guides},clear:function(t){this.frontGuideGroup.clear(t),this.backGuideGroup.clear(t)},destroy:function(){this.frontGuideGroup.clear(),this.backGuideGroup.clear()}}),t.exports=a},function(t,e,n){"use strict";var i=n(4),r=function(t){i.mix(this,t),this.init()};i.augment(r,{graph:null,tooltipDOM:null,titleDOM:null,listDOM:null,tooltipCSS:{border:"none","border-radius":"4px",background:"rgba(33,33,33,0.7)",color:"white","font-size":"14px",margin:0,padding:"8px 16px"},titleCSS:{margin:0},listCSS:{margin:0,"list-style-type":"none",padding:"0px"},title:"",dx:10,dy:10,margin:10,split:": ",tooltipHtml:'
',titleHtml:'

',listHtml:'
    ',liTpl:"
  • {name}{split}{value}
  • ",init:function(){this._createDOM(),this._bindEvent()},_createDOM:function(){var t=this.graph,e=t.get("graphContainer"),n=i.createDOM(this.tooltipHtml,this.tooltipCSS),r=i.createDOM(this.titleHtml,this.titleCSS),a=i.createDOM(this.listHtml,this.listCSS);e.appendChild(n),n.appendChild(r),n.appendChild(a),n.hide(),r.innerHTML=this.title,this.titleDOM=r,this.listDOM=a,this.tooltipDOM=n},_bindEvent:function(){var t=this.graph;t.on("itemmouseenter",i.wrapBehavior(this,"onMouseenter")),t.on("itemhover",i.wrapBehavior(this,"onItemhover")),t.on("itemmouseleave",i.wrapBehavior(this,"onMouseleave"))},_changeContent:function(t){var e=this,n=this.listDOM,r=this.liTpl,a="";t&&(i.isArray(t[0])||(t=[t]),i.each(t,function(t){a+=i.substitute(r,{name:t[0],value:t[1],split:e.split})}),n.innerHTML=a)},_getTop:function(t,e,n){var i=this.dy;return 2*t.height>=e.height?"0px":n=e.width?"0px":e.width-n-i',{position:"relative"});e.appendChild(c);var h=i(s,u,c),l=c.appendChild(o.createDOM('
    ')),f=i(s,u,c),d=f.get("el");h.set("htmlElementContaniner",l),l.style.overflow="hidden",l.style.width=s+"px",l.style.height=u+"px",l.style.position="absolute",l.style.top=0,l.style.left=0,d.style.position="absolute",d.style.top=0,d.style.left=0,c.style["font-family"]=x.fontFamily;var g=a?h.addGroup(m):h.addGroup(),p=f.addGroup(m),v=g.addGroup(),w=g.addGroup(),b=r?w.addGroup(y):w.addGroup(),_=w.addGroup(),M=g.addGroup();g.set("gid","rootGroup"),p.set("gid","frontCanvasRootGroup"),v.set("animate",!1),t.set("rootGroup",g),t.set("itemGroup",w),t.set("backGroup",v),t.set("frontGroup",M),t.set("frontCanvasRootGroup",p),t.set("nodeGroup",_),t.set("edgeGroup",b),t.set("canvas",h),t.set("frontCanvas",f),t.set("graphContainer",c),t.set("htmlElementContaniner",l),t.set("container",e),t.set("el",d),d.style.outline="none",d.setAttribute("tabIndex",-2),t.on("click",function(){d.focus()})},_initEvent:function(){var t=new d({graph:this,frontCanvas:this.get("frontCanvas"),canvas:this.get("canvas"),rootGroup:this.get("rootGroup")});this.set("eventAssist",t)},_updateGrid:function(){var t=this.get("gridAssist");if(t){var e=this,n=e.get("width"),i=e.get("height"),r=e.invertPoint({x:0,y:0}),a=e.invertPoint({x:n,y:i});t.update({minX:r.x,minY:r.y,maxX:a.x,maxY:a.y})}},_updateCache:function(t,e){var n=this.get("itemCache");n[t]=e},_clearInner:function(){var t=this.get("guideAssist"),e=this.get("animate"),n=!e,i=this.get("htmlElementContaniner");i.innerHTML="",this.get("nodeGroup").clear(n),this.get("edgeGroup").clear(n),this.get("frontCanvasRootGroup").clear(),t.clear(n)},_updateEdgeEnd:function(t,e,n){var i=this,r=i.get("itemCache"),a=e[n],o=t.get(n);if(!o||o.get("id")!==a){o&&o.removeEdge(t);var s=r[a];s.addEdge(t),t.set(n,s)}},_drawInner:function(){this._drawItems(),this._drawGuides()},_drawItems:function(){var t=this.get("nodes"),e=this.get("edges");this.addNodes(t),this.addEdges(e)},_drawGuides:function(){var t=this.get("guideAssist");t.draw()},_readSource:function(){},_saveSource:function(){},_readGuides:function(t){var e=this;o.each(t,function(t){e.get("guides").push(t)})},_saveGuides:function(){var t=this.get("guideAssist");return t.save()},_getAllActived:function(){var t=this.getAllActived();return t.sort(function(t,e){var n,i,r=t.get("group"),a=e.get("group");return r&&(n=r.get("parent"),i=n.get("children")),i.indexOf(r)-i.indexOf(a)}),t},removeItem:function(t){var e,n=this,i=n.get("itemCache");if(o.isString(t)&&(t=i[t]),e=t.get("id"),delete i[e],"node"===t.get("type")){var r=t.get("edges").slice();o.each(r,function(t){delete i[t.get("model").id],n.removeItem(t)})}t.destroy()},css:function(t){var e=this.get("el");o.each(t,function(t,n){e.style[n]=t})},addNodes:function(t){var e=this,n=e.get("nodeGroup"),i=e.get("itemCache"),r=[];return o.each(t,function(t){var a=t.id;if(o.isNull(a)&&(a=o.guid(),t.id=a),i[a])throw new Error("id: "+a+" \u5df2\u5b58\u5728\uff01id: "+a+" already exist!");var s=n.addGroup(w,{id:a,type:"node"}),u=new l.Node({id:a,graph:e,group:s,model:t,mapper:e.get("nodeMapper"),frontCanvasRootGroup:e.get("frontCanvasRootGroup")});e._updateCache(a,u),r.push(u),u.draw(),e.get("items").push(u)}),r},read:function(t){var e=this;o.each(t,function(t,n){e["_read"+o.ucfirst(n)](t)})},save:function(){return{source:this._saveSource(),guides:this._saveGuides()}},addEdges:function(t){var e=this,n=e.get("itemCache"),i=e.get("edgeGroup"),r=[];return o.each(t,function(t){var a=t.id,s=n[t.source],u=n[t.target];if(!s||!u)throw new Error("can not find effective node in edge model");if(n[a])throw new Error("id: "+a+" \u5df2\u5b58\u5728\uff01id: "+a+" already exist!");o.isNull(a)&&(a=o.guid(),t.id=a);var c=i.addGroup(w,{id:a,type:"edge"}),h=new l.Edge({id:a,graph:e,source:s,target:u,model:t,group:c,mapper:e.get("edgeMapper"),useAnchor:e.get("useAnchor"),frontCanvasRootGroup:e.get("frontCanvasRootGroup")});h.draw(),e._updateCache(a,h),r.push(h),e.get("items").push(h)}),r},invertPoint:function(t){var e=this.get("rootGroup").getMatrix();return o.invertPoint(t,e)},converPoint:function(t){var e=this.get("rootGroup").getMatrix();return o.converPoint(t,e)},forceFit:function(){var t=this.get("container"),e=o.getDOMWidth(t),n=this.get("height");e!==this.get("width")&&this.changeSize(e,n)},tooltip:function t(e){var n=this.get("tooltipAssist"),t={graph:this};return e?(o.isObject(n)&&n.destroy(),o.isObject(e)&&o.mix(t,e),n=new g(t),this.set("tooltipAssist",n)):(n&&n.destroy(),this.set("tooltipAssist",null)),this},getItem:function(t){if(!t)return null;var e=t.get("parent"),n=this.get("itemCache");return n[e.get("id")]},updateMatrix:function(t){var e=this,n=e.get("rootGroup"),i=e.get("frontCanvasRootGroup");n.setMatrix(t),i.setMatrix(t.clone()),e._updateGrid()},toFront:function(t){var e=t.get("group"),n=e.get("parent"),i=n.get("children");return o.remove(i,e),i.push(e),self},toBack:function(t){var e=t.get("group"),n=e.get("parent"),i=n.get("children");return o.remove(i,e),i.unshift(e),self},source:function(t,e){this.set("nodes",t),this.set("edges",e)},guide:function(){var t=this.get("guideAssist");return t},node:function(){return this.get("nodeMapper")},edge:function(){return this.get("edgeMapper")},clear:function(){this._clearInner(),this._initMapper(),this._initData(),this._initEditor()},draw:function(t){var e=this,n=e.get("animateAssist"),i=e.get("drawFrameObj");o.frameDraw(i,function(){e.destroyed||(n?t!==!1?n.run():(n.init(),e.refresh(!1)):e.refresh(!1))})},refreshFront:function(){this.get("frontCanvas").draw()},refresh:function(){this.get("canvas").draw(),this.get("frontCanvas").draw()},updateNodesPosition:function(t){var e,n=this.get("itemCache"),i=this.get("edges");o.each(t,function(t){e=n[t.id],e.updatePosition(t)}),o.each(i,function(t){n[t.id].update()}),this.draw()},updateItem:function(t,e){var n,i,r=this.get("itemCache");if(o.isString(t)&&(t=r[t]),n=t.get("type"),i=t.get("model"),o.mix(i,e),"edge"===n)this._updateEdgeEnd(t,i,"source"),this._updateEdgeEnd(t,i,"target"),t.update();else if("node"===n){t.update();var a=t.get("edges");o.each(a,function(t){t.update()})}return this.fire("itemupdate",{item:t}),t},add:function(){},update:function(){},remove:function(){},render:function(){this._drawInner(),this._fitView(),this.draw()},changeLayout:function(t){var e=this.save();this._clearInner(),this._initData(),this.set("layout",t),this.read(e),this._drawInner(),this.draw()},changeData:function(){var t=o.toArray(arguments);this._clearInner(),this._initData(),this._initEditor(),this.source.apply(this,t),this._drawInner(),this.draw()},changeSize:function(t,e){if(Math.abs(t)>=1/0||Math.abs(e)>=1/0)return void console.warn("size parameter more than the maximum");var n=this,i=n.get("canvas"),r=n.get("frontCanvas"),a=n.get("htmlElementContaniner");i.changeSize(t,e),r.changeSize(t,e),n.set("width",t),n.set("height",e),a.css({width:t+"px",height:e+"px"}),n._updateGrid(),n.draw(!1)},getMatrix:function(){var t=this.get("rootGroup");return t.getMatrix()},destroy:function(){var t=this,e=t.get("canvas"),n=t.get("gridAssist"),i=t.get("guideAssist"),r=t.get("tooltipAssist"),a=t.get("eventAssist"),s=t.get("container"),u=t.get("graphContainer");s&&s.removeChild(u),a&&a.destroy(),n&&n.destroy(),r&&r.destroy(),i&&i.destroy(),e&&e.destroy(),b.superclass.destroy.call(this),window.removeEventListener("resize",o.getWrapBehavior(this,"_initForceFitEvent"))},find:function(t){var e=this,n=e.get("itemCache");return n[t]},isNode:function(t){return t&&o.isObject(t)&&"node"===t.get("type")},isEdge:function(t){return t&&o.isObject(t)&&"edge"===t.get("type")},snapshot:function(){var t=this.get("canvas"),e=t.get("el");return e.toDataURL("image/png")},downloadImage:function(t){var e=this.snapshot(),n=document.createElement("a"),i=t?t:"chart.png";return n.download=i,n.href=e.replace("image/png","image/octet-stream"),n.click(),n}}),t.exports=b},function(t,e,n){"use strict";var i=n(4),r=n(26),a=n(7),o=function t(e){t.superclass.constructor.call(this,e),this._initEnds()};o.ATTRS={type:"edge",controlPoints:[null,null],source:null,target:null,sourceAnchor:null,targetAnchor:null},i.extend(o,r),i.augment(o,{_initEnds:function(){var t=this,e=t.get("source"),n=t.get("target");e&&e.addEdge(t),n&&n.addEdge(t)},_getEdgePoints:function(){var t,e=this,n=e.get("model"),r=e.get("source"),o=e.get("target"),s=e.get("useAnchor"),u=e.getControlPoints(),c=n.sourceAnchor,h=n.targetAnchor,l=r.getCenter(),f=o?o.getCenter():r.getCenter(),d=u.length,g=e.getShapeCfg(),p=e.get("shapeManger"),v=0,x=d-1;return s?(null===c&&delete n.sourceAnchor,null===h&&delete n.targetAnchor,i.isNumber(c)&&r&&(c=r.getAnchor(c)),i.isNumber(h)&&o&&(h=o.getAnchor(h)),d>2?(r&&!c&&(c=r.getAnchor(u[v+1])),o&&!h&&(h=o.getAnchor(u[x-1]))):(t=a.preciseAnchor&&p.getPath(g.shape,[l,f]),r&&!c&&(c=t?r.getAnchor(t):r.getAnchor(f)),o&&!h&&(h=t?o.getAnchor(t):o.getAnchor(l))),u[0]={x:c.x,y:c.y},u[x]={x:h.x,y:h.y},u):(u[0]={x:l.x,y:l.y},u[x]={x:f.x,y:f.y},u)},beforeDraw:function(){o.superclass.beforeDraw.call(this);var t=this.getShapeCfg(),e=this.get("group");t.points=this._getEdgePoints(),t.target=this.get("target"),t.source=this.get("source"),e.set("controlPoints",this.get("controlPoints"))},getControlPoints:function(){var t=this.get("model"),e=t.controlPoints?t.controlPoints:this.get("controlPoints");return e},addControlPoint:function(t){var e,n,r,a=this.getControlPoints(),o=1/0;return i.each(a,function(s,u){if(n=a[u+1]){if(r=i.segmentDistance(s,n,t),r<1)return e=u,!1;r1?r:r[0]}}),t.exports=r},function(t,e,n){"use strict";var i=n(4),r=function(){};i.augment(r,{isItemActived:function(t){return t.isActived()},setItemActived:function(t,e){this.setItemsActived([t],e)},setItemsActived:function(t,e){if(0!==t.length){var n=this;e!==!1?i.each(t,function(t){t.setActived(),n.fire("itemactived",{item:t})}):i.each(t,function(t){t.clearActived(),n.fire("itemunactived",{item:t})})}},getItems:function(){var t=this.get("itemCache");return i.getObjectValues(t)},getActived:function(){var t=this,e=t.getItems(),n=null;return i.each(e,function(e){if(t.isItemActived(e))return n=e,!1}),n},getAllActived:function(){var t=this,e=t.getItems(),n=[];return i.each(e,function(e){t.isItemActived(e)&&n.push(e)}),n},clearAllActived:function(){var t=this,e=t.getAllActived();return this.setItemsActived(e,!1),this}}),t.exports=r},function(t,e,n){"use strict";var i=n(1),r=function(){};i.augment(r,{setActiveStatus:function(){},isActived:function(){return this.get("actived")},setActived:function(){this.setActiveStatus(!0),this.set("actived",!0)},clearActived:function(){this.setActiveStatus(!1),this.set("actived",!1)}}),t.exports=r},function(t,e,n){"use strict";var i=n(1),r=n(2),a=n(7),o=r.Matrix3,s=function(){};s.ATTRS={fitView:null,fitViewPadding:a.fitViewPadding},i.augment(s,{_fitView:function(){var t=this.get("fitView"),e=this.get("items");i.isString(t)&&e.length>0&&this[t](!1),i.isObject(t)&&this.focusPoint(t,!1)},_zoom:function(t,e,n){var i,r,a=new o,s=this.get("width"),u=this.get("height"),c=this.get("itemGroup"),h=c.getBBox(),l=(h.maxX+h.minX)/2,f=(h.maxY+h.minY)/2,d=this.get("fitViewPadding"),g=l,p=f;i=h.maxX-h.minX+2*d,r=h.maxY-h.minY+2*d,n&&(g=n.x,p=n.y),e&&(s=i,u=r,this.changeSize(i,r)),t||(t=s/i,s/i>u/r&&(t=u/r)),a.translate(-g,-p),a.scale(t,t),a.translate(s/2,u/2),this.updateMatrix(a)},zoomAt:function(t,e,n){var i=new o;i.translate(-t,-e),i.scale(n,n),i.translate(t,e),this.updateMatrix(i)},zoom:function(t,e){this._zoom(t),e!==!1&&this.draw()},autoZoom:function(t){this._zoom(),t!==!1&&this.draw()},resetZoom:function(t){var e=new o;this.updateMatrix(e),t!==!1&&this.draw()},autoSize:function(t){this._zoom(void 0,!0),t!==!1&&this.draw()},tl:function(){var t=this.get("itemGroup"),e=t.getBBox(),n=t.getMatrix().clone(),i=this.get("fitViewPadding");n.translate(-e.minX+i,-e.minY+i),this.updateMatrix(n)},lc:function(){var t=this.get("itemGroup"),e=t.getBBox(),n=t.getMatrix().clone(),i=this.get("fitViewPadding"),r=this.get("height");n.translate(-e.minX+i,-e.minY+r/2-e.height/2),this.updateMatrix(n)},bl:function(){var t=this.get("itemGroup"),e=t.getBBox(),n=t.getMatrix().clone(),i=this.get("fitViewPadding"),r=this.get("height");n.translate(-e.minX+i,-e.minY+r-e.height-i),this.updateMatrix(n)},cc:function(){var t=this.get("itemGroup"),e=t.getBBox(),n=t.getMatrix().clone(),i=this.get("height"),r=this.get("width");n.translate(-e.minX+(r-e.width)/2,-e.minY+(i-e.height)/2),this.updateMatrix(n)},tc:function(){var t=this.get("itemGroup"),e=t.getBBox(),n=t.getMatrix().clone(),i=this.get("width"),r=this.get("fitViewPadding");n.translate(-e.minX+(i-e.width)/2,-e.minY+r),this.updateMatrix(n)},tr:function(){var t=this.get("itemGroup"),e=t.getBBox(),n=t.getMatrix().clone(),i=this.get("width"),r=this.get("fitViewPadding");n.translate(-e.minX+i-e.width-r,-e.minY+r),this.updateMatrix(n)},rc:function(){var t=this.get("itemGroup"),e=t.getBBox(),n=t.getMatrix().clone(),i=this.get("height"),r=this.get("width"),a=this.get("fitViewPadding");n.translate(-e.minX+r-e.width-a,-e.minY+(i-e.height)/2),this.updateMatrix(n)},br:function(){var t=this.get("itemGroup"),e=t.getBBox(),n=t.getMatrix().clone(),i=this.get("height"),r=this.get("width"),a=this.get("fitViewPadding"); +n.translate(-e.minX+r-e.width-a,-e.minY+i-e.height-a),this.updateMatrix(n)},bc:function(){var t=this.get("itemGroup"),e=t.getBBox(),n=t.getMatrix().clone(),i=this.get("height"),r=this.get("width"),a=this.get("fitViewPadding");n.translate(-e.minX+(r-e.width)/2,-e.minY+i-e.height-a),this.updateMatrix(n)},focusPoint:function(t,e){this._zoom(1,void 0,t),e!==!1&&this.draw()}}),t.exports=s},function(t,e,n){"use strict";function i(t,e){var n,i;for(n=0;nMath.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&&ur&&n.splice(r,a-r+1),t.current=0}},copy:function(){var t,e,n,r=this,o=r.getAllActived(),s=r.get("clipboard"),u={};s.nodes=[],s.edges=[],i.each(o,function(c){t=i.mix(!0,{},c.get("model"),{id:a.guid()}),u[c.get("model").id]=t.id,r.isNode(c)?(t.x+=10,t.y-=10,s.nodes.push(t)):(e=c.get("model").target,n=c.get("model").source,e=r.find(e),n=r.find(n),o.indexOf(e)!==-1&&o.indexOf(n)!==-1&&(t.controlPoints&&i.each(t.controlPoints,function(e,n){t.controlPoints[n]={x:e.x+=10,y:e.y-=10}}),t.target=u[t.target],t.source=u[t.source],s.edges.push(t)))}),this.refresh()},paste:function(){var t=this,e=t.get("clipboard"),n=t.addNodes(e.nodes);n=n.concat(t.addEdges(e.edges)),t.clearAllActived(),t.setItemsActived(n),e.nodes=[],e.edges=[],t.updateRollback(),this.refresh()},del:function(){var t=this,e=t.getAllActived();i.each(e,function(e){t.removeItem(e)}),this.updateRollback(),this.refresh()},updo:function(){var t=this.get("rollback");if(i.isObject(t)){var e=t.cache,n=t.current,r=n+1,a=e[r];0!==e.length&&a&&(a=i.clone(a),this._changeData(a.nodes,a.edges),t.current=r,this.refresh())}},redo:function(){var t=this.get("rollback");if(i.isObject(t)){var e=t.cache,n=t.current,r=n-1,a=e[r];0!==e.length&&a&&(a=i.clone(a),this._changeData(a.nodes,a.edges),t.current=r,this.refresh())}},beginAdd:function(t,e){this.changeMode("add"),this.set("addingType",t),this.set("addingModel",e)},endAdd:function(t){this.changeMode("edit"),this.set("addingType",""),this.set("addingModel",null),t&&this.fire("afteradd",{item:t})}}),t.exports=u},function(t,e,n){"use strict";var i=n(3),r=n(153);r.Mode={default:["dragNode","dragEdge","dragBlank","clickBlankClearActive","resizeEdge","clickActive","resizeNode","wheelZoom"],edit:["dragNode","dragEdge","clickBlankClearActive","resizeEdge","clickActive","multiSelect","resizeNode","shortcut","wheelZoom"],drag:["shortcut","dragCanvas","wheelZoom"],add:["clickAddNode","dragAddEdge"],complicated:["dragCanvas","wheelZoom","dragHideEdges","wheelZoomHideEdges"],analysis:["dragCanvas","wheelZoom","dragHideEdges","dragHideTexts","wheelZoomHideEdges","wheelZoomHideTexts"]},i.registMode(r),t.exports=r},function(t,e,n){"use strict";var i=n(1),r=n(151),a=n(11),o=function t(e){t.superclass.constructor.call(this,e)};o.ATTRS={defaultNodeShape:"rect"},i.extend(o,a),i.mixin(o,[r]),i.augment(o,{_initCfg:function(){var t=this.get("mode");"analysis"===t&&(this.set("useAnchor",!1),this.set("useFreezeSizeGroup",!0),this.set("useSortGroup",!1),this.set("grid",null))},_readSource:function(t){this.source(t.nodes,t.edges)},_saveSource:function(){function t(t,e){i.each(t.get("children"),function(t){var n=t.get("id"),i=s[n];e.push(i.get("model"))})}var e=this,n=[],r=[],a=e.get("nodeGroup"),o=e.get("edgeGroup"),s=e.get("itemCache");return t(a,n),t(o,r),i.clone({nodes:n,edges:r})},render:function(t){void 0===t&&(t=this.get("rollback")),o.superclass.render.call(this),t!==!1&&this.updateRollback()},add:function(t,e){var n,i=this;return"node"===t?n=i.addNodes([e]):"edge"===t&&(n=i.addEdges([e])),this.draw(),n[0]},update:function(t,e){this.updateItem(t,e),this.draw()},remove:function(t){this.removeItem(t),this.draw()}}),t.exports=o},function(t,e,n){"use strict";var i=n(1),r=n(18),a=n(23),o=n(155),s=n(7),u=n(11),c=a.Util,h=u.Util,l=function t(e){t.superclass.constructor.call(this,e)};l.ATTRS={layoutFn:r.CompactBoxTree,layoutCfg:{direction:"LR",getHGap:function(){return 40},getVGap:function(){return 10}},layout:null,grid:null,data:null,dataMap:null,showButton:!0,defaultNodeShape:"tree-node",animate:!0},i.extend(l,u),i.augment(l,{_readSource:function(t){this.source(t)},_saveSource:function(){var t=this.get("data"),e=o.clone(t,{parent:!0});return e},_createMap:function(t){var e={};return t.root=!0,t.id||(t.id=h.guid()),e[t.id]=t,o.traverseTree(t,function(t,n){t.id||(t.id=h.guid()),t.parent=n,e[t.id]=t}),e},_setWidthHeight:function(){var t,e,n=this.get("itemCache"),r=this.get("dataMap"),a=h.getObjectValues(r);this.set("nodes",a),this._drawItems(),i.each(a,function(i){t=i.id,e=n[t].getBBox(),r[t].width=e.width,r[t].height=e.height}),this._clearInner(),this._initData()},_drawInner:function(){var t=this.get("data"),e=this.get("layout");this._checkData(t)&&(this.set("dataMap",this._createMap(t)),this._setWidthHeight(),e.root=t,this.set("nodes",e.getNodes()),this.set("edges",e.getEdges())),l.superclass._drawInner.call(this)},source:function(t){this.set("data",t)},reRender:function(){var t=this.get("data");this.clearAllActived(),this.refreshFront(),this._clearInner(),this._initData(),this.source(t),this._drawInner(),this.draw()},enterAnimate:function(t,e,n){var i,r=h.getBBox(t,t),a=r.centerX,s=r.centerY,u=t.get("shapeCfg"),l=u.origin;i="node"===t.get("type")?o.getButtonPoint(l,e,a,s):o.getButtonPoint(n[l.target].model,e,a,s),c.scaleIn(t,i.x,i.y,a,s)},leaveAnimate:function(t,e,n){var i,r=h.getBBox(t,t),a=r.centerX,s=r.centerY,u=t.get("shapeCfg"),l=u.origin;i="node"===t.get("type")?o.getButtonPoint(l,n,a,s):o.getButtonPoint(e[l.target].model,n,a,s),c.scaleOut(t,i.x,i.y)},beforeNodeDraw:function(t){var e=this,n=t.getShapeCfg(),i=e.get("layout");n.direction=i.options.direction,t.addChild=function(n){return e.add(t.get("id"),n)}},afterNodeDraw:function(t){var e,n,i=this.get("showButton"),r=t.get("group"),a=t.getShapeCfg(),u=t.getKeyShape(),c=t.get("shapeObj"),l=a.origin,f=u.getBBox(),d=l.inAnchor,g=l.outAnchor;if(c.getAnchorPoints=function(){return d?[d,g]:"center"},e=t.calculateAnchorPoints(f),!l.root&&e){switch(n=h.getpointInRectQuadrant(f,e[1])){case 0:a.buttonX=e[1].x,a.buttonY=e[1].y-s.treeButtonRadius;break;case 1:a.buttonX=e[1].x+s.treeButtonRadius,a.buttonY=e[1].y;break;case 2:a.buttonX=e[1].x,a.buttonY=e[1].y+s.treeButtonRadius;break;case 3:a.buttonX=e[1].x-s.treeButtonRadius,a.buttonY=e[1].y;break;default:a.buttonX=e[1].x,a.buttonY=e[1].y}if(l.isCollapsed?a.buttonType="plus":a.buttonType="minus",!i)return r.set("buttonX",(f.minX+f.maxX)/2),void r.set("buttonY",(f.minY+f.maxY)/2);l.children&&0!==l.children.length&&o.drawButton(a,r),r.set("buttonX",a.buttonX),r.set("buttonY",a.buttonY)}},add:function(t,e){var n=this.get("dataMap"),r=n[t],a=e.id;return a||(a=i.guid(),e.id=a),i.isArray(r.children)?r.children.push(e):r.children=[e],this.reRender(),this.find(a)},remove:function(t){var e,n,r=this.get("dataMap");return i.isString(t)&&(t=r[t]),n=t.parent,n?(e=n.children,n.children=i.filter(e,function(e){return t!==e})):this.source({}),this.reRender(),this},update:function(t,e){return l.superclass.updateItem.call(this,t,e),this.reRender(),t},_checkData:function(t){return t&&i.isObject(t)&&h.getObjectValues(t).length>0}}),t.exports=l},function(t,e,n){"use strict";var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=n(1),a=n(11),o=n(7),s=a.Util,u={traverseTree:function(t,e){var n=t.children;r.each(n,function(n){e(n,t),n.children&&u.traverseTree(n,e)})},getButtonPoint:function(t,e,n,i){for(var r,a=t.parent;t&&a&&!e[a.id];)a=a.parent;return a?(r=e[a.id].origin,s.applyPoint({x:r.get("buttonX"),y:r.get("buttonY")},r)):{x:n,y:i}},clone:function(t,e){var n;if(r.isArray(t)){n=[];for(var a=0,o=t.length;a - - - - - - - - - - - + + + + + + + + + - - - -
    + + + +
    \ No newline at end of file diff --git a/web-network/client/index.html b/web-network/client/index.html index a0703f4..3dde831 100644 --- a/web-network/client/index.html +++ b/web-network/client/index.html @@ -11,14 +11,8 @@ - - - + + @@ -29,6 +23,8 @@ env: "production", }; + +
    diff --git a/web-network/client/src/sections/network/actions/network.js b/web-network/client/src/sections/network/actions/network.js index 2e87cac..955496f 100644 --- a/web-network/client/src/sections/network/actions/network.js +++ b/web-network/client/src/sections/network/actions/network.js @@ -1,6 +1,7 @@ 'use strict'; -import { ApiTable, basicAction } from '$utils' +import { basicAction } from '@peace/utils'; +import { ApiTable } from '$utils'; export function getOrganizationsStruc (id) { @@ -129,3 +130,19 @@ export function findAlarmsDevice (id) { }) } + +export default { + getOrganizationsStruc, + getThingsDeploy, + getDeviceMetaDeployed, + getIotaThingsLlinkStatus, + getIotaThingsLlinkStatus, + findDeviceMetaDeployed, + findSensorLastData, + getDevicesAlarms, + findDevicesCardStatus, + getDevicesLlinkStatus, + findAlarmsDevice, + +} + diff --git a/web-network/client/src/sections/network/components/device-tree/edit-map.js b/web-network/client/src/sections/network/components/device-tree/edit-map.js index d0cce62..9a2fb05 100644 --- a/web-network/client/src/sections/network/components/device-tree/edit-map.js +++ b/web-network/client/src/sections/network/components/device-tree/edit-map.js @@ -1,7 +1,7 @@ import React, { useState, useEffect } from 'react'; import { PinyinHelper } from '@peace/utils'; -const { G6 } = window; +// const { G6 } = window; let uniqueId = 0; function generateUniqueId() { diff --git a/web-network/client/src/sections/network/components/device-tree/zuwang-main.js b/web-network/client/src/sections/network/components/device-tree/zuwang-main.js index 7022feb..11a54bd 100644 --- a/web-network/client/src/sections/network/components/device-tree/zuwang-main.js +++ b/web-network/client/src/sections/network/components/device-tree/zuwang-main.js @@ -34,7 +34,7 @@ export default function ({ ...props }) { // const da = useThingsLinkStatus(struct?.iotaThingId); const getThingsLinkStatus = (isCycle = false) => { - const iotaThingId = struct?.iotaThingId; + const iotaThingId = struct?.thingId; if (iotaThingId) { const url = ApiTable.getIotaThingsLlinkStatus.replace('{iotaThingId}', iotaThingId); Request.get(url).then((res) => { diff --git a/web-network/client/src/sections/network/containers/device-monitor.js b/web-network/client/src/sections/network/containers/device-monitor.js index f858806..1b7bf18 100644 --- a/web-network/client/src/sections/network/containers/device-monitor.js +++ b/web-network/client/src/sections/network/containers/device-monitor.js @@ -14,13 +14,14 @@ import { DeviceTypes } from '../constant'; import qs from "qs"; import '../style.less'; -import TableShow from './tableShow' -function DeviceMonitor({ ...props }) { - const { - dispatch, actions, user, clientWidth, clientHeight, loading, - myStructList, deviceMetasWithFollow, devices, dimensions, deviceListAlarms, factorStations, - } = props; - +// import TableShow from './tableShow' +function DeviceMonitor ({ ...props }) { + const { + dispatch, actions, user, clientWidth, clientHeight, loading, + myStructList, deviceMetasWithFollow, devices, dimensions, deviceListAlarms, factorStations, + } = props; +console.log(3213,actions); + const { analysis } = actions const [params, setParams] = useState({}); const [selectStructure, setSelectStructure] = useState(null); @@ -34,17 +35,10 @@ function DeviceMonitor({ ...props }) { useEffect(() => { - - - // dispatch(actions.dataMonitor.getDeviceMeta()); - // dispatch(actions.dataMonitor.getMyStructList(user?.orgId)).then((res) => { - // if (res.success) { - // const data = res?.payload?.data || []; - // if (data.length > 0) { - // setSelectStructure(data[0]?.id); - // } - // } - // }); + if (strucParam?.thingId) { + dispatch(analysis.getThingsDeploy(strucParam?.thingId)) + dispatch(analysis.getDeviceMetaDeployed(strucParam?.thingId)) + } }, []); useEffect(() => { @@ -66,10 +60,7 @@ function DeviceMonitor({ ...props }) { } }, [selectStructure]); - // 结构物切换 - const sturctureChange = (value) => { - setSelectStructure(value); - }; + // 展示切换 const onExtraChange = (e) => { setExtraType(e.target.value); @@ -190,43 +181,30 @@ function DeviceMonitor({ ...props }) { return ( //
    div
    // - - - - { - extraType === 'tree' - ? (myStructList.find((v) => v.id === selectStructure) - && deviceMetasWithFollow?.devices?.length > 0 - && devices.instances) - ? ( - v.id === selectStructure)} - clientHeight={clientHeight} - clientWidth={clientWidth} - /> - ) : - : ( - - ) - } - - + + + { + extraType === 'tree' + ? deviceMetasWithFollow?.devices?.length > 0 + && devices.instances + ? ( + + ) : + : ( +
    + // + ) + } +
    +
    //
    ); } diff --git a/web-network/client/src/sections/network/containers/tableShow.js b/web-network/client/src/sections/network/containers/tableShow.js deleted file mode 100644 index 375f376..0000000 --- a/web-network/client/src/sections/network/containers/tableShow.js +++ /dev/null @@ -1,341 +0,0 @@ -import React, { useEffect, useState, useRef, useMemo } from 'react' -import { connect } from 'react-redux' -import { Spin, Card, CardGroup, Form, Button, Table, Pagination, Tooltip } from '@douyinfe/semi-ui' - import { ExportData } from '@peace/components'; -import moment from 'moment' - -const Network = props => { - const { dispatch, actions, user, clientHeight, thingId, deviceListAlarms, devicesCardStatusList, project } = props - const { analysis } = actions - const form = useRef() //表单 - const [deployData, setDeployData] = useState([]) - const [deviceData, setDeviceData] = useState([]) - const [deviceMetasDeployed, setDeviceMetasDeployed] = useState([]) - const [sensorId, setSensorId] = useState([]) - const [sensorsDataItems, setSensorsDataItems] = useState({}) - const [tableData, setTableData] = useState([]) //最新一次的数据 - const [lastData, setLastData] = useState([]) //最终数据 - const [lastDataCopy, setLastDataCopy] = useState([]) //最终数据 - const [searchType, setSearchType] = useState('') - const [searchName, setSearchName] = useState('') - const [typeList, setTypeList] = useState([]) - const [query, setQuery] = useState({ limit: 10, page: 0 }) //页码信息 - - const DeviceTypes = { - 'DTU': 'DTU', - 'gateway': '网关', - 'sensor': '传感器', - 'acqUnit': '采集单元', - 'dau.gateway': '分布式智能云采集网关', - 'dau.node': '分布式智能云采集节点', - 'tcp.dtu': '工作站', - } - - useEffect(() => { - setLastData([]) - setLastDataCopy([]) - }, [project]) - - useEffect(() => { - if (thingId) { - let dataList = [] - dispatch(analysis.getThingsDeploy(thingId)).then(rs => { - if (rs.success) { - setDeployData(rs.payload.data) - dataList = rs.payload.data - //列表渲染数据 - let da = [] - if (dataList.instances) { - Object.keys(dataList.instances).forEach(i => { - if (dataList.instances[i].type == 's.d') { - da.push({ - sensorId: i, - sensorName: dataList.instances[i]?.name, - deviceType: dataList?.instances[i]?.instance?.properties?.deviceType, - collectTime: '--', - data: '--', - iotCardStatus: '--', - status: '--', - option: '--', - }) - } - }) - } - - dispatch(analysis.findDeviceMetaDeployed(thingId)).then(res => { - if (res.success) { - setDeviceMetasDeployed(res.payload.data) - const deviceMetaDeployed = res.payload.data - if (deviceMetaDeployed && dataList && deviceMetaDeployed.devices) { - const sensorsId = [] - let alarmSensorId = [] //所有设备的id - const sensorsDataItems = {} - for (const id in dataList.instances) { - alarmSensorId.push(id) - const instances = dataList.instances[id] - - if (instances.type == 's.d' && instances.instance.properties.deviceType == 'sensor') { - const meta = deviceMetaDeployed.devices.find(m => m.id == instances.instance.deviceMetaId) - sensorsDataItems[id] = { - items: {}, - deviceName: instances.name, - } - if (meta) { - sensorsDataItems[id].items = meta.capabilities[0].properties.reduce((p, n) => { - if (n.category == 'Output') { - p[n.name] = { name: n.showName, unit: n.unit } - } - return p - }, {}) - } - sensorsId.push(id) - } - } - dispatch(analysis.getDevicesAlarms({ deviceIds: alarmSensorId }, { limit: 5 })) - dispatch(analysis.findDevicesCardStatus({ deviceIds: alarmSensorId })) - setSensorsDataItems(sensorsDataItems) - setSensorId(sensorsId) - setDeviceData(da) - } - } - }) - } - }) - } - }, [thingId]) - useEffect(async () => { - if (sensorId && sensorId.length && sensorsDataItems) { - const rs = await dispatch(analysis.findSensorLastData(sensorId)) - const tableData = [] - if (rs.success) { - rs.payload.data.forEach(sd => { - if (Object.keys(sensorsDataItems).length) { - let sensorDataItem = sensorsDataItems[sd.sensorId] - let sensorName = sensorDataItem && sensorDataItem.deviceName ? sensorDataItem.deviceName : '' - let msg = sd.data.length - ? sd.data[0] - : { - collectTime: null, - sensorName: sensorName, - data: { noData: '暂无数据' }, - } - let dataStr = '' - let dataKeys = Object.keys(msg.data) - dataKeys.forEach(k => { - let item = sensorDataItem && sensorDataItem.items ? sensorDataItem.items[k] : null - if (item) { - dataStr += `${item.name}:${msg.data[k]}(${item.unit}); ` - } else if (k == 'noData') { - dataStr += msg.data[k] - } else { - dataStr += `${k}:${msg.data[k]};` - } - }) - let collectTime = msg.collectTime ? moment(msg.collectTime).format('YYYY-MM-DD HH:mm:ss') : '--' - tableData.push({ - sensorId: sd.sensorId, - sensorName: sensorName, - collectTime: collectTime, - data: dataStr, - deviceType: 'sensor', //传感器 - iotCardStatus: '--', - status: '--', - option: '--', - }) - } - }) - } - setTableData(tableData) - } - }, [sensorId]) - useEffect(() => { - if (deviceData && deviceData.length ) { - const dataD = deviceData?.map(p => { - const objRslt = tableData?.find(q => q.sensorId == p.sensorId) - return { - sensorId: objRslt ? objRslt.sensorId : p.sensorId, - sensorName: objRslt ? objRslt.sensorName : p.sensorName, - collectTime: objRslt ? objRslt.collectTime : p.collectTime, - data: objRslt ? objRslt.data : p.data, - deviceType: DeviceTypes[objRslt ? objRslt.deviceType : p.deviceType], - iotCardStatus: - devicesCardStatusList && devicesCardStatusList.length - ? devicesCardStatusList.find(v => v.deviceId == p.sensorId).status === 0 - ? '正常' - : devicesCardStatusList.find(v => v.deviceId == p.sensorId).status === 1 - ? '未激活' - : '停机' - : '--', - status: - deviceListAlarms && deviceListAlarms.length - ? deviceListAlarms?.find(v => v.deviceId == p.sensorId) - ? '异常' - : '正常' - : '--', - option: objRslt ? objRslt.option : p.option, - } - }) - const typeList = dataD.reduce((p, c) => { - let isExist = p.some(q => q.label === c.deviceType) - if (!isExist) { - p.push({ label: c.deviceType, value: c.sensorId }) - } - return p - }, []) - setTypeList(typeList) - setLastData(dataD) - setLastDataCopy(dataD) - } - }, [deviceData]) - // const lastDataCopy=useMemo(()=>{ - // return lastData - // },[thingId]) - const scroll = useMemo(() => ({ y:clientHeight-600+175 }), []) - //名称回调事件 - const inputChange = e => { - setSearchName(e) - } - //选择设备类型下拉框回调 - const selectChange = e => { - let rslt=typeList.find(f => f.value == e) - setSearchType(rslt?rslt.label:undefined) - } - - //查询事件回调 - const searchHandler = () => { - setLastData( - lastDataCopy.filter(f => - (searchName === undefined || f.sensorName.includes(searchName)) && - (searchType === undefined || f.deviceType===searchType) - ) - ) - } - - const columns = [ - { - title: '设备名称', - dataIndex: 'sensorName', - width: '20%', - key: 'sensorName', - render: (_, r) => { - return ( - <> - -
    {r.sensorName.length > 7 ? `${r.sensorName.substr(0, 7)}...` : r.sensorName}
    -
    - - ) - }, - }, - { - title: '设备类型', - dataIndex: 'deviceType', - width: '15%', - key: 'deviceType', - }, - { - title: '最后采集时间', - dataIndex: 'collectTime', - width: '15%', - key: 'collectTime', - }, - { - title: '数据', - dataIndex: 'data', - width: '20%', - key: 'data', - render: (_, r) => { - return ( - <> - -
    {r.data.length > 6 ? `${r.data.substr(0, 6)}...` : r.data}
    -
    - - ) - }, - }, - { - title: '物联网卡状态', - width: '15%', - dataIndex: 'iotCardStatus', - key: 'iotCardStatus', - }, - { - title: '状态', - width: '10%', - dataIndex: 'status', - key: 'status', - }, - { - title: '操作', - width: '10%', - dataIndex: 'option', - key: 'option', - }, - ] - return ( - <> -
    -
    -
    - } - field='name' - pure - showClear - label='名称' - style={{ width: 260, marginRight: 12 }} - placeholder='请输入设备名称' - onChange={inputChange} - /> - - - -
    -
    - {' '} - {lastData.length ? ( - - ) : ( - '' - )} -
    -
    -
    - - ) -} - -function mapStateToProps(state) { - const { auth, global, members, webSocket, deviceListAlarms, devicesCardStatus } = state - return { - user: auth.user, - actions: global.actions, - clientHeight: global.clientHeight, - deviceListAlarms: deviceListAlarms?.data || [], - devicesCardStatusList: devicesCardStatus?.data || [], - } -} - -export default connect(mapStateToProps)(Network) diff --git a/web-network/client/src/sections/network/index.js b/web-network/client/src/sections/network/index.js index 351b94b..3a5a3bb 100644 --- a/web-network/client/src/sections/network/index.js +++ b/web-network/client/src/sections/network/index.js @@ -6,7 +6,7 @@ import actions from './actions'; import { getNavItem } from './nav-item'; export default { - key: 'dataMonitor', + key: 'analysis', name: '实时监控', reducers: reducers, routes: routes,