chunk-0495ff90.052aaddd.js 7.9 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0495ff90","chunk-0495ff90"],{"067f":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r={version:"3.5.2",rootContainerClassName:"root-container",nodeContainerClassName:"node-container",edgeContainerClassName:"edge-container",comboContainerClassName:"combo-container",customGroupContainerClassName:"custom-group-container",delegateContainerClassName:"delegate-container",defaultShapeFillColor:"#C6E5FF",defaultShapeStrokeColor:"#5B8FF9",defaultLoopPosition:"top",nodeLabel:{style:{fill:"#595959",textAlign:"center",textBaseline:"middle"},offset:5},defaultNode:{type:"circle",style:{fill:"#C6E5FF",lineWidth:1,stroke:"#5B8FF9"},size:20,color:"#5B8FF9"},edgeLabel:{style:{fill:"#595959",textAlign:"center",textBaseline:"middle"}},defaultEdge:{type:"line",style:{stroke:"#e2e2e2"},size:1,color:"#e2e2e2"},comboLabel:{style:{fill:"#595959",textBaseline:"middle"},refY:10,refX:10},defaultCombo:{type:"circle",style:{fill:"#F3F9FF",lineWidth:1,stroke:"#A3B1BF",opacity:.8,r:5,width:20,height:10},size:[20,5],color:"#A3B1BF",padding:[25,20,15,20]},nodeStateStyle:{},delegateStyle:{fill:"#F3F9FF",fillOpacity:.5,stroke:"#1890FF",strokeOpacity:.9,lineDash:[5,5]}};t.default=r},"6a23":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shapeBase=t.CLS_LABEL_BG_SUFFIX=void 0;var r=a("9ab4"),n=s(a("067f")),i=a("e897"),o=a("8937");function s(e){return e&&e.__esModule?e:{default:e}}var l="-shape",c="-label",f="-label-bg";t.CLS_LABEL_BG_SUFFIX=f;var u={options:{},itemType:"",type:"",draw:function(e,t){var a=this.drawShape(e,t);if(a.set("className",this.itemType+l),e.label){var r=this.drawLabel(e,t);r.set("className",this.itemType+c)}return a},afterDraw:function(e,t,a){},drawShape:function(e,t){return null},drawLabel:function(e,t){var a=this.options.labelCfg,r=(0,o.mix)({},a,e.labelCfg),n=this.getLabelStyle(e,r,t),s=n.rotate;delete n.rotate;var l=t.addShape("text",{attrs:n,draggable:!0,className:"text-shape",name:"text-shape"});if(s){var c=l.getBBox(),u=l.getMatrix();if(u||(u=i.mat3.create()),n.rotateCenter)switch(n.rotateCenter){case"center":u=(0,i.transform)(u,[["t",-c.width/2,-c.height/2],["r",s],["t",c.width/2,c.height/2]]);break;case"lefttop":u=(0,i.transform)(u,[["t",-n.x,-n.y],["r",s],["t",n.x,n.y]]);break;case"leftcenter":u=(0,i.transform)(u,[["t",-n.x,-n.y-c.height/2],["r",s],["t",n.x,n.y+c.height/2]]);break;default:u=(0,i.transform)(u,[["t",-c.width/2,-c.height/2],["r",s],["t",c.width/2,c.height/2]]);break}else u=(0,i.transform)(u,[["t",-n.x,-n.y-c.height/2],["r",s],["t",n.x,n.y+c.height/2]]);l.setMatrix(u)}if(n.background){var d=this.drawLabelBg(e,t,l),g=this.itemType+f;d.set("classname",g),l.toFront()}return l},drawLabelBg:function(e,t,a){var r=this.options.labelCfg,n=(0,o.mix)({},r,e.labelCfg),i=this.getLabelBgStyleByPosition(a,e,n,t),s=t.addShape("rect",{name:"text-bg-shape",attrs:i});return s},getLabelStyleByPosition:function(e,t,a){return{text:e.label}},getLabelBgStyleByPosition:function(e,t,a,r){return{}},getLabelStyle:function(e,t,a){var r=this.getLabelStyleByPosition(e,t,a),i=this.itemType+"Label",o=n.default[i]?n.default[i].style:null,s=Object.assign({},o,r,t.style);return s},getShapeStyle:function(e){return e.style},update:function(e,t){this.updateShapeStyle(e,t),this.updateLabel(e,t)},updateShapeStyle:function(e,t){var a=t.getContainer(),r=t.getKeyShape(),n=(0,o.mix)({},r.attr(),e.style),i=function(e){var t,i=n[e];if((0,o.isPlainObject)(i)){var s=a.find((function(t){return t.get("name")===e}));s&&s.attr(i)}else r.attr((t={},t[e]=i,t))};for(var s in n)i(s)},updateLabel:function(e,t){var a=t.getContainer(),n=this.options.labelCfg,s=this.itemType+c,l=a.find((function(e){return e.get("className")===s})),u=this.itemType+f,d=a.find((function(e){return e.get("classname")===u}));if(e.label||""===e.label)if(l){var g={};t.getModel&&(g=t.getModel().labelCfg);var h=(0,o.deepMix)({},n,g,e.labelCfg),p=this.getLabelStyleByPosition(e,h,a),y=e.labelCfg?e.labelCfg.style:void 0,b=h.style&&h.style.background,v=Object.assign({},l.attr(),p,y),m=v.rotate;if(delete v.rotate,m){var S=i.mat3.create();S=(0,i.transform)(S,[["t",-v.x,-v.y],["r",m],["t",v.x,v.y]]),l.resetMatrix(),l.attr((0,r.__assign)((0,r.__assign)({},v),{matrix:S}))}else l.resetMatrix(),l.attr(v);if(d)if(v.background){var C=this.getLabelBgStyleByPosition(l,e,h,a),x=Object.assign({},C,b);d.resetMatrix(),m&&d.rotateAtStart(m),d.attr(x)}else a.removeChild(d);else v.background&&(d=this.drawLabelBg(e,a,l),d.set("classname",u),l.toFront())}else{var F=this.drawLabel(e,a);F.set("className",s)}},afterUpdate:function(e,t){},setState:function(e,t,a){var r,n,i=a.get("keyShape");if(i){var s=a.getType(),l=(0,o.isBoolean)(t)?e:e+":"+t,c=this.getStateStyle(l,!0,a),f=a.getStateStyle(l),u=(0,o.mix)({},f||c),d=a.getContainer();if(t){var g=function(e){var t,a=u[e];if((0,o.isPlainObject)(a)){var r=d.find((function(t){return t.get("name")===e}));r&&r.attr(a)}else i.attr((t={},t[e]=a,t))};for(var h in u)g(h)}else{var p=(0,o.clone)(a.getCurrentStatesStyle()),y=(0,o.clone)(a.getOriginStyle()),b=i.get("name"),v=i.attr(),m={},S=function(e){var t=u[e];if((0,o.isPlainObject)(t)){var a=d.find((function(t){return t.get("name")===e}));if(a){var r=a.attr();(0,o.each)(t,(function(e,t){r[t]&&delete r[t]})),m[e]=r}}else{var n=["x","y","cx","cy"];!v[e]||n.indexOf(e)>-1||delete v[e]}};for(var C in u)S(C);for(var h in b?m[b]=v:(0,o.mix)(m,v),p){var x=p[h];(0,o.isPlainObject)(x)||(b?(0,o.mix)(y[b],(n={},n[h]=x,n)):(0,o.mix)(y,(r={},r[h]=x,r)),delete p[h])}var F={};(0,o.deepMix)(F,y,m,p);var B=function(e){var t,a,r=F[e];if((0,o.isPlainObject)(r)){var n=d.find((function(t){return t.get("name")===e}));n&&n.attr(r)}else"combo"===s?b||i.attr((t={},t[e]=r,t)):i.attr((a={},a[e]=r,a))};for(var w in F)B(w)}}},getStateStyle:function(e,t,a){var r=a.getModel();if(t){var n=r.stateStyles?r.stateStyles[e]:this.options.stateStyles&&this.options.stateStyles[e];return(0,o.mix)({},r.style,n)}return{}},getControlPoints:function(e){return e.controlPoints},getAnchorPoints:function(e){var t=this.options.anchorPoints,a=e.anchorPoints||t;return a}};t.shapeBase=u},"7da3":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a("8937"),n={};function i(e){return n[e]||(n[e]=(0,r.upperFirst)(e)),n[e]}var o={defaultShapeType:"defaultType",className:null,getShape:function(e){var t=this,a=t[e]||t[t.defaultShapeType];return a},draw:function(e,t,a){var r=this.getShape(e),n=r.draw(t,a);return r.afterDraw&&r.afterDraw(t,a,n),n},baseUpdate:function(e,t,a){var r=this.getShape(e);r.update&&r.update(t,a),r.afterUpdate&&r.afterUpdate(t,a)},setState:function(e,t,a,r){var n=this.getShape(e);n.setState(t,a,r)},shouldUpdate:function(e){var t=this.getShape(e);return!!t.update},getControlPoints:function(e,t){var a=this.getShape(e);return a.getControlPoints(t)},getAnchorPoints:function(e,t){var a=this.getShape(e);return a.getAnchorPoints(t)}},s={options:{},draw:function(e,t){return this.drawShape(e,t)},drawShape:function(){},afterDraw:function(){},afterUpdate:function(){},setState:function(){},getControlPoints:function(e){return e.controlPoints},getAnchorPoints:function(e){var t=this.options.anchorPoints,a=e.anchorPoints||t;return a}},l=function(){function e(){}return e.registerFactory=function(t,a){var r=i(t),n=o,s=Object.assign({},n,a);return e[r]=s,s.className=r,s},e.getFactory=function(t){var a=i(t);return e[a]},e.registerNode=function(t,a,r){var n=e.Node,i=r?n.getShape(r):s,o=Object.assign({},i,a);return o.type=t,o.itemType="node",n[t]=o,o},e.registerEdge=function(t,a,r){var n=e.Edge,i=r?n.getShape(r):s,o=Object.assign({},i,a);return o.type=t,o.itemType="edge",n[t]=o,o},e.registerCombo=function(t,a,r){var n=e.Combo,i=r?n.getShape(r):s,o=Object.assign({},i,a);return o.type=t,o.itemType="combo",n[t]=o,o},e}(),c=l;t.default=c,l.registerFactory("node",{defaultShapeType:"circle"}),l.registerFactory("edge",{defaultShapeType:"line"}),l.registerFactory("combo",{defaultShapeType:"circle"})}}]);