New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

webcmp-topo-chart-vertical

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webcmp-topo-chart-vertical - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

2

bundles/webcmp-topo-chart-vertical.umd.min.js

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("@angular/router"),require("lodash"),require("@antv/g6"),require("@antv/util"),require("@ngx-translate/core"),require("ng-zorro-antd/tooltip"),require("ng-zorro-antd/icon")):"function"==typeof define&&define.amd?define("webcmp-topo-chart-vertical",["exports","@angular/core","@angular/common","@angular/router","lodash","@antv/g6","@antv/util","@ngx-translate/core","ng-zorro-antd/tooltip","ng-zorro-antd/icon"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["webcmp-topo-chart-vertical"]={},t.ng.core,t.ng.common,t.ng.router,t._,t.G6,t.util,t.core$1,t.tooltip,t.icon)}(this,(function(t,e,i,l,n,o,a,r,s,d){"use strict";function c(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var u=c(n),h=c(o);Object.create;function g(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var l,n,o=i.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(l=o.next()).done;)a.push(l.value)}catch(t){n={error:t}}finally{try{l&&!l.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return a}function f(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(g(arguments[e]));return t}var p,v,m,y,x,b,S,k,C;Object.create;!function(t){t.Add="add",t.Delete="delete",t.Update="update",t.Match="match",t.Hover="hover",t.Neighbor="neighbor",t.Selected="select",t.Click="click",t.Active="active",t.HoverNeighbor="hoverNeighbor"}(p||(p={})),function(t){t.Running="running",t.Selected="select"}(v||(v={})),function(t){t.Solid="solid",t.Dashed="dashed"}(m||(m={})),function(t){t.Edit="edit",t.Compare="compare",t.Default="default"}(y||(y={})),function(t){t.SOLID="solid",t.DASHED="dashed",t.DOTTED="dotted"}(x||(x={}));var w="#fff",D=w,I="#3E425B",W="#DDDDDD",O="#3370ff",z="#4881F6",N="#8753F6",E="#3479E8",L="#548CFF",B="#EEF3FE",_="#3479E8",j={modes:(b={},b[y.Default]=["activate-relations","click-select"],b[y.Edit]=["drag-canvas","drag-node","activate-relations","click-add-node","click-select","click-add-edge"],b[y.Compare]=["drag-canvas","drag-node","activate-relations","click-select"],b),defaultNode:{type:"custom-circle-left",size:42,draggable:!0,outerCircleStyle:{r:26},iconStyle:{fill:I,fontSize:12,fontFamily:"iconfont",textAlign:"center",textBaseline:"middle",cursor:"pointer"},iconImageStyle:{width:15,height:15,cursor:"pointer"},countStyle:{fill:"#16181D",label:{fill:"#fff"}},style:{lineWidth:1,stroke:I,fill:D,r:21,zIndex:2,cursor:"pointer"},labelCfg:{fontWeight:400,style:{fill:w,textAlign:"left",fontSize:12,cursor:"pointer",textBaseline:"middle"}}},nodeStateStyles:(S={},S[p.Neighbor]={lineWidth:2,stroke:E,fill:D},S[p.Hover]=(k={lineWidth:2,stroke:w,fill:L,icon:{stroke:w,fill:w},link:{stroke:z,fill:z}},k[p.Match]={lineWidth:1,stroke:N,fill:D},k),S[p.Selected]={lineWidth:2,stroke:E,fill:L,icon:{stroke:E,fill:D}},S[p.Neighbor]={lineWidth:2,stroke:_,fill:B,icon:{stroke:E,fill:_}},S[p.HoverNeighbor]={lineWidth:2,stroke:_,fill:B,icon:{stroke:E,fill:_}},S),defaultEdge:{type:"solid",size:1,draggable:!0,color:W,style:{zIndex:1}},edgeStateStyles:(C={},C[v.Running]={stroke:O},C[v.Selected]={stroke:O},C)};function T(t,e){var i=t.style;if(!e)return i;var l=i[e];return Object.assign(Object.assign({},i),l)}function H(t,e,i){var l=h.default.Util.getTextSize("...",i)[0],n=0,o=t,a=new RegExp("[一-龥]+");return null==t||t.split("").forEach((function(r,s){n>e-l||(a.test(r)?n+=i:n+=h.default.Util.getLetterWidth(r,i),n>e-l&&(o=t.substr(0,s)+"..."))})),o}var M=h.default.Util,P=M.getLabelPosition,A=M.transform;function R(t,e,i){var l,n=null===(l=null==i?void 0:i._cfg)||void 0===l?void 0:l.group,o=null==n?void 0:n.findById("marker"),a=null==i?void 0:i.get("keyShape"),r=i.getStates();if(t!==v.Selected&&t!==v.Running||!e||o||(o=null==n?void 0:n.addShape("marker",{id:"marker",attrs:{x:16,y:0,r:8,lineWidth:2,stroke:a.cfg.attrs[v.Running].stroke,symbol:function(t,e){return[]}}})),r.includes(v.Selected)){var s=i.getStateStyle(v.Selected);a.attr("stroke",s.stroke);var d=a.getPoint(.5);P(a,.5);o.attr({x:d.x,y:d.y}),o.stopAnimate()}else if(t!==v.Selected||e){if(t===v.Running){a.cfg.running=e;s=T(i._cfg.model,i._cfg.model.status);if(e){var c=T(i._cfg.model,v.Running);null==o||o.animate((function(t){var e=a.getPoint(t),i=P(a,t),l=[1,0,0,0,1,0,0,0,1];return l=A(l,[["t",-e.x,-e.y],["r",i.angle],["t",e.x,e.y]]),{x:e.x,y:e.y}}),{duration:1e3}),a.attr("stroke",c.stroke)}else a.attr("stroke",s.stroke||W),null==o||o.resetMatrix(),null==o||o.stopAnimate(),null==o||o.hide()}}else{var u=T(i._cfg.model);a.attr("endArrow",!1),a.attr("stroke",u.stroke),o.hide()}}var G,q=require("../static/icons/iconfont.json");function F(t){var e=q.glyphs.map((function(t){return{name:t.name,unicode:String.fromCodePoint(t.unicode_decimal)}})),i=e.find((function(e){return e.name===t}))||{unicode:String.fromCodePoint(59036),name:"asset_default"};return i.unicode}var X=require("../images/drill.svg"),U=require("../images/add.svg"),V=require("../images/delete.svg"),Y=require("../images/update.svg"),K=require("../images/view.svg"),$="-label",J=[3,6],Q=((G={})[p.Add]=U,G[p.Delete]=V,G[p.Update]=Y,G);p.Add,p.Delete,p.Update;function Z(t,e){h.default.registerNode("custom-circle-left",{drawLabelType:function(t,e,i){var l,n,o,a,r=(this.mergeStyle||this.getOptions(t)||{}).labelCfg||{},s=this.getLabelStyle(t,r,e),d=this.getShapeStyle(t,null==t?void 0:t.status),c=H(null==t?void 0:t.targetTypeName,110,null===(n=null===(l=null==t?void 0:t.labelCfg)||void 0===l?void 0:l.style)||void 0===n?void 0:n.fontSize),u=null==e?void 0:e.addShape("text",{attrs:Object.assign(Object.assign({},s),{text:c,x:d.r+18,y:30-d.r,fontSize:null===(a=null===(o=null==t?void 0:t.labelCfg)||void 0===o?void 0:o.style)||void 0===a?void 0:a.fontSize}),draggable:!0,id:i||"targettype",zIndex:5,visible:!1,name:i||"targettype",overflow:c!==(null==t?void 0:t.targetType)});return console.log("targetType",t.targetType),u},drawLabel:function(t,e,i){var l,n,o,a,r=(this.mergeStyle||this.getOptions(t)||{}).labelCfg||{},s=this.getLabelStyle(t,r,e),d=this.getShapeStyle(t,null==t?void 0:t.status),c=H(null==t?void 0:t.label,110,null===(n=null===(l=null==t?void 0:t.labelCfg)||void 0===l?void 0:l.style)||void 0===n?void 0:n.fontSize),u=Object.assign(Object.assign({},s),{text:c,x:d.r+18,y:10-d.r,fontSize:null===(a=null===(o=null==t?void 0:t.labelCfg)||void 0===o?void 0:o.style)||void 0===a?void 0:a.fontSize});return(null==t?void 0:t.count)&&(u.y=0),null==e?void 0:e.addShape("text",{attrs:u,draggable:!0,id:i||"label",zIndex:3,visible:!1,name:i||"label",overflow:c!==(null==t?void 0:t.label)})},drawText:function(t,e,i,l,n,o,a){var r,s,d=(this.mergeStyle||this.getOptions(t)||{}).labelCfg||{},c=this.getLabelStyle(t,d,e);return null==e?void 0:e.addShape("text",{attrs:Object.assign(Object.assign({},c),{text:i,x:n,fontSize:null===(s=null===(r=null==t?void 0:t.labelCfg)||void 0===r?void 0:r.style)||void 0===s?void 0:s.fontSize,fill:o?N:c.fill,visible:!1}),draggable:!0,id:"text_"+a,zIndex:3,name:"label",overflow:l,visible:!1})},drawStatus:function(t,e){var i=this.getShapeStyle(t,null==t?void 0:t.status);return e.addShape("image",{attrs:{img:Q[t.status],y:-i.r-8,x:10},zIndex:3,draggable:!0,name:"status-image",id:"status-image"})},drawShape:function(t,e,i){var l=this.getShapeStyle(t),n=l.stroke,o=function(t,e){var i={};for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&e.indexOf(l)<0&&(i[l]=t[l]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(l=Object.getOwnPropertySymbols(t);n<l.length;n++)e.indexOf(l[n])<0&&Object.prototype.propertyIsEnumerable.call(t,l[n])&&(i[l[n]]=t[l[n]])}return i}(l,["stroke"]);t.count&&t.children&&(o.r=o.r+5);var a=e.addShape("circle",{attrs:Object.assign(Object.assign({},o),{stroke:n}),name:i||"inner-circle",id:i||"inner-circle",draggable:!0,zIndex:i?4:3});return console.log("circle",o),a},drawIcon:function(t,e,i){var l,o=t.icon,a=this.getShapeStyle(t,null==t?void 0:t.status);if(/^http/.test(l=o)||/^blob:http/.test(l)||/^data:image\/.*;base64/.test(l)){var r=n.get(t,"iconImageStyle")||{};e.addShape("image",{attrs:Object.assign(Object.assign({},r),{img:t.icon,x:-a.r/2,y:-a.r/2}),zIndex:i?5:4,draggable:!0,name:i?"icon-image-active":"icon-image",id:i?"icon-image-active":"icon-image"})}else{(r=n.get(t,"iconStyle")||{}).fill=i||t.isAlert?"#FFF":r.fill,e.addShape("text",{attrs:Object.assign(Object.assign({},r),{text:F(t.icon),fontSize:18}),zIndex:i?5:4,draggable:!0,name:i?"text-iconfont-active":"text-iconfont",id:i?"text-iconfont-active":"text-iconfont"})}},drawOuterCircleShape:function(t,e,i){var l=this.getShapeStyle(t,null==t?void 0:t.status),n=null==e?void 0:e.addShape("circle",{attrs:Object.assign(Object.assign({},l),{r:l.r+8,lineWidth:2,fill:w,visibility:"hidden"}),name:i||"outer-circle",id:i||"outer-circle",draggable:!0,zIndex:2});return t.status===p.Delete&&n.attr("lineDash",J),n},drawOuterRectShape:function(t,e,i){var l,n=this.getShapeStyle(t);null===(l=e.findById("label"))||void 0===l||l.getBBox().maxX;return null==e?void 0:e.addShape("rect",{attrs:Object.assign(Object.assign({},n),{width:160,height:2*(n.r+8)+1,y:-(n.r+8+.5)}),name:i||"outer-rect",id:i||"outer-rect",draggable:!0,zIndex:1})},drawCountContainer:function(t,e,i){var l=this.getShapeStyle(t);return null==e?void 0:e.addShape("rect",{attrs:Object.assign(Object.assign({},l),{width:160,height:2*(l.r+5),y:-(l.r+5+2),radius:[0,17,4,0]}),name:i||"count-container",id:i||"count-container",draggable:!0,zIndex:1})},drawImageLink:function(e,i,l){var n=this.getShapeStyle(e,null==e?void 0:e.status),o=(i.findById("label").getBBox().maxX,null==i?void 0:i.addShape("image",{attrs:{x:171,y:4-n.r,cursor:"pointer",img:X,width:12,height:12},name:l||"image-drill",draggable:!0,zIndex:5,id:l||"image-drill",visible:!1}));return null==o||o.on("mouseenter",(function(t){t.stopPropagation(),o.attr("width",14),o.attr("height",14)})),null==o||o.on("mouseleave",(function(t){t.stopPropagation(),o.attr("width",12),o.attr("height",12)})),null==o||o.on("click",(function(i){i.stopPropagation(),t("url",e)})),o},drawImageView:function(e,i,l){var n=this.getShapeStyle(e,null==e?void 0:e.status),o=(i.findById("label").getBBox().maxX,null==i?void 0:i.addShape("image",{attrs:{x:170,y:e.showLink?n.r-16:n.r-28,cursor:"pointer",img:K,width:14,height:14},name:l||"image-view",draggable:!0,zIndex:8,id:l||"image-view",visible:!1}));return null==o||o.on("mouseenter",(function(t){t.stopPropagation(),o.attr("x",169),o.attr("width",16),o.attr("height",16)})),null==o||o.on("mouseleave",(function(t){t.stopPropagation(),o.attr("x",170),o.attr("width",14),o.attr("height",14)})),null==o||o.on("click",(function(i){i.stopPropagation(),console.log("image",e),t("drill",e)})),o},drawOuterLinkShape:function(t,e,i){var l,n=this.getShapeStyle(t);null===(l=e.findById("label"))||void 0===l||l.getBBox().maxX;return null==e?void 0:e.addShape("rect",{attrs:Object.assign(Object.assign({},n),{width:33,height:2*(n.r+8+.5),y:-(n.r+8+.5),x:160,fill:z,stroke:z,radius:[0,17,4,0]}),name:i||"outer-link",id:i||"outer-link",draggable:!0,zIndex:1,visible:!1})},drawCount:function(e,i){var l=this.getShapeStyle(e),o=(n.toString(e.count),null==i?void 0:i.findById("count-rect")),a=null==i?void 0:i.findById("count-rect-text");if(o&&(null==i||i.removeChild(o),null==i||i.removeChild(a)),e.count){console.log("group",e,l,i);var r=e.countStyle,s=e.alertNum?e.alertNum+"/"+e.count:""+e.count,d=7*s.length+6+8+8;e.children||(d-=8);var c=null==i?void 0:i.addShape("rect",{attrs:Object.assign(Object.assign({},l),{width:d,height:16,x:-d/2,y:l.r-6,fill:"#001A4F",radius:3,lineWidth:0}),name:"count-rect",id:"count-rect",draggable:!0,zIndex:20,visible:!0});if(e.children)i.addShape("polygon",{attrs:{points:[[-d/2+4,l.r+2],[-d/2+8,l.r+6],[-d/2+8,l.r-2]],fill:"#fff",cursor:"pointer"},name:"marker-shape",id:"marker-shape-left",draggable:!0,zIndex:50,visible:!0}),i.addShape("polygon",{attrs:{points:[[d/2-4,l.r+2],[d/2-8,l.r+6],[d/2-8,l.r-2]],fill:"#fff",cursor:"pointer"},name:"marker-shape",id:"marker-shape-left",draggable:!0,zIndex:50,visible:!0});var u=null==i?void 0:i.addShape("text",{attrs:{text:s,y:l.r-4,fontSize:12,textAlign:"center",textBaseline:"top",width:d,fill:r.label.fill},name:"count-rect-text",id:"count-rect-text",draggable:!0,zIndex:20,visible:!0});null==c||c.on("click",(function(i){i.stopPropagation(),t("count",e)})),null==u||u.on("click",(function(i){i.stopPropagation(),t("count",e)}))}},getShapeStyle:function(t,e){var i=t.style;if(!e)return i;var l=i[e];return Object.assign(Object.assign({},i),l)},draw:function(t,e){var i=this.drawShape(t,e),l=this.drawOuterCircleShape(t,e);if(null==t?void 0:t.label){var n=this.drawLabel(t,e);n.set("className",this.itemType+$),e.shapeMap[this.itemType+$]=n}if((null==t?void 0:t.targetType)&&!(null==t?void 0:t.count)&&this.drawLabelType(t,e),t.showLink&&this.drawImageLink(t,e),t.hideView||this.drawImageView(t,e),(null==t?void 0:t.status)&&this.drawStatus(t,e),t.icon&&this.drawIcon(t,e),t.count&&(this.drawCount(t,e),t.children)){var o=this.drawCountContainer(t,e);null==o||o.hide()}t.status||null==l||l.hide();var a=this.drawOuterRectShape(t,e);return this.drawOuterLinkShape(t,e),null==a||a.hide(),null==e||e.sort(),i},setState:function(t,i,l){if(!l._cfg.group.destroyed){var o=null==l?void 0:l.getContainer().findById("outer-circle"),a=l.getContainer().findById("count-container"),r=null==l?void 0:l.getContainer().findById("outer-rect"),s=null==l?void 0:l.getContainer().findById("image-drill"),d=null==l?void 0:l.getContainer().findById("image-view"),c=null==l?void 0:l.getContainer().findById("label"),u=null==l?void 0:l.getContainer().findById("targettype"),h=l.getStates(),g=l.getKeyShape(),f=l.getContainer().findById("text-iconfont"),v=l.getContainer().findById("outer-link"),m=null==l?void 0:l.getContainer().findById("text_0"),y=null==l?void 0:l.getContainer().findById("text_1"),x=null==l?void 0:l.getContainer().findById("text_2"),b=null==l?void 0:l.getContainer().findById("count-rect"),S=(null==l||l.getContainer().findById("count-rect-text"),null==l?void 0:l.getContainer().findById("inner-circle")),k=l.getModel(),C=null==k?void 0:k.isAlert,D=l._cfg.group,I=l.getStateStyle(p.Hover)||j.nodeStateStyles.hover,W=(n.get(I,"icon")||j.nodeStateStyles.hover.icon,null==b||b.getBBox(),this.getShapeStyle(k));if("hover"===t)if(i){var O=(H=I).link||{};l.toFront(),null==o||o.show(),null==r||r.show(),null==s||s.show(),null==c||c.show(),null==u||u.show(),null==d||d.show(),null==v||v.show(),null==m||m.show(),null==y||y.show(),null==x||x.show(),console.log("hoverItem",l.getModel(),l),null==c||c.attr("fill",H.stroke),null==c||c.attr("textAlign","left"),null==u||u.attr("fill",H.stroke),null==u||u.attr("textAlign","left"),r.attr("fill",H.fill),r.attr("stroke",H.fill),null==a||a.attr("fill",H.fill),null==a||a.attr("stroke",H.fill),o.attr("stroke",H.fill),o.attr("lineDash",void 0),o.attr("lineWidth",H.lineWidth),g.attr("fill",H.fill),g.attr("stroke",H.fill),null==f||f.attr("fill",w),v.attr("fill",O.fill),v.attr("stroke",O.stroke),console.log("cfg",k.hasChildren),k.count&&k.children?(null==a||a.show(),console.log(o.getBBox(),W),o.attr("r",W.r+7),null==r||r.hide(),null==v||v.hide()):(null==a||a.hide(),o.attr("r",W.r+8),null==r||r.show(),null==v||v.show()),e(l)}else{var B=this.getShapeStyle(k);g.attr("fill",B.fill),g.attr("stroke",B.stroke),o.attr("stroke",B.stroke),k.status||null==o||o.hide(),o.attr("stroke",B.stroke),k.status===p.Delete&&o.attr("lineDash",J);var _=n.get(k,"iconStyle")||{};null==f||f.attr("fill",_.fill),null==r||r.hide(),null==s||s.hide(),null==d||d.hide(),null==c||c.hide(),null==u||u.hide(),v.hide(),null==m||m.hide(),null==y||y.hide(),null==x||x.hide(),null==a||a.hide()}if(t===p.Selected&&!i){B=this.getShapeStyle(k);g.attr("fill",B.fill),o.attr("stroke",B.fill),o.attr("lineWidth",B.lineWidth),null==o||o.hide()}if(t===p.Click&&!i){B=this.getShapeStyle(k);g.attr("fill",B.fill),g.attr("stroke",B.stroke),o.attr("stroke",B.stroke),o.attr("lineWidth",B.lineWidth),k.status||null==o||o.hide(),o.attr("stroke",B.stroke),o.attr("lineWidth",B.lineWidth),k.status===p.Delete&&o.attr("lineDash",J);var T=n.get(k,"iconStyle")||{};null==f||f.attr("fill",T.fill),null==r||r.hide(),null==s||s.hide(),null==d||d.hide(),null==c||c.hide(),null==u||u.hide(),v.hide(),null==m||m.hide(),null==y||y.hide(),null==x||x.hide()}if((t===p.Neighbor||t===p.Match||t===p.HoverNeighbor)&&!i){var H=I,M=(B=this.getShapeStyle(k),k.iconStyle||j.defaultNode.iconStyle);g.attr("fill",B.fill),g.attr("stroke",B.stroke),null==f||f.attr("fill",M.fill)}if(t===p.Match&&!i){B=this.getShapeStyle(k);m&&D.removeChild(m),y&&D.removeChild(y),x&&D.removeChild(x),g.attr("stroke",B.stroke)}if(h.includes(p.HoverNeighbor)){H=l.getStateStyle(p.HoverNeighbor)||j.nodeStateStyles.hoverNeighbor;var P=n.get(H,"icon")||j[p.HoverNeighbor].icon;g.attr("fill",H.fill),g.attr("stroke",H.stroke),o.attr("stroke",H.fill),null==f||f.attr("fill",P.stroke)}if(h.includes(p.Neighbor)){H=l.getStateStyle(p.Neighbor)||j.nodeStateStyles[p.Neighbor];var A=n.get(H,"icon")||j[p.Neighbor].icon;if(C){var R=I;g.attr("fill",R.fill),g.attr("stroke",R.fill),o.attr("stroke",R.fill),o.attr("lineWidth",R.lineWidth),null==f||f.attr("fill",w)}else g.attr("fill",H.fill),g.attr("stroke",H.stroke),o.attr("stroke",H.fill),o.attr("lineWidth",H.lineWidth),null==f||f.attr("fill",A.stroke)}if(h.includes(p.Selected)){H=l.getStateStyle(p.Selected)||j.nodeStateStyles.select;g.attr("fill",H.fill),o.attr("stroke",H.fill),o.attr("lineWidth",H.lineWidth),null==o||o.show()}if(h.includes(p.Click)){O=(H=I).link||{};C||(H.stroke=w,H.fill=L,O.fill=z),l.toFront(),k.count&&k.children||null==o||o.show(),k.hideRect||(null==r||r.show(),null==v||v.show(),null==s||s.show(),null==c||c.show()),null==u||u.show(),null==d||d.show(),null==m||m.show(),null==y||y.show(),null==x||x.show(),null==c||c.attr("fill",H.stroke),null==c||c.attr("textAlign","left"),null==u||u.attr("fill",H.stroke),null==u||u.attr("textAlign","left"),r.attr("fill",H.fill),r.attr("stroke",H.fill),null==o||o.attr("stroke",H.fill),null==o||o.attr("lineDash",void 0),null==o||o.attr("lineWidth",H.lineWidth),g.attr("fill",H.fill),g.attr("stroke",H.fill),null==f||f.attr("fill",w),v.attr("fill",O.fill),v.attr("stroke",O.stroke)}if(h.includes(p.Match)){var G=l.getModel();H=I[p.Match]||j.nodeStateStyles.hover.match;g.attr("stroke",H.stroke);var q=l._cfg.prefix;if(q){var F=c.cfg.attrs.text,X=F.toLowerCase().indexOf(q.toLowerCase());c.hide(),null==u||u.hide();var U=X>0?F.substring(0,X):F.substring(0,X+q.length),V=X>0?F.substring(X,X+q.length):F.substring(X+q.length),Y=X>0?F.substring(X+q.length):"",K=this.getShapeStyle(G);if(U&&(m||(m=this.drawText(G,D,U,!0,K.r+10,U.toLowerCase()===q.toLowerCase(),0))),V&&!y){var $=K.r+10;m&&($=m.getBBox().maxX+1),y=this.drawText(G,D,V,!0,$,V.toLowerCase()===q.toLowerCase(),1)}if(Y&&!x){$=K.r+10;y&&($=y.getBBox().maxX+1),this.drawText(G,D,Y,!0,$,Y.toLowerCase()===q.toLowerCase(),2)}}}t===p.Match&&i&&(S.attr("stroke",N),S.attr("lineWidth",2)),t!==p.Match||i||(S.attr("stroke",E),S.attr("lineWidth",1))}},update:function(t,e,i){this.updateLabel(t,e,i),this.updateIcon(t,e,i),this.updateShapeStyle(t,e,i),this.updateStatus(t,e,i)},updateShapeStyle:function(t,e){var i,l=e.getContainer(),n=e.getKeyShape(),o=this.getShapeStyle(t);this.drawCount(t,l);var r=function(e){var r,s,d=o[e];if(a.isPlainObject(d)){var c=(null===(i=l.shapeMap)||void 0===i?void 0:i[e])||l.find((function(t){return t.get("name")===e}));null==c||c.attr(d)}else t.count&&t.children&&"r"===e?n.attr(((r={})[e]=d+5,r)):n.attr(((s={})[e]=d,s))};for(var s in o)r(s)},updateInCircleShape:function(t,e){this.drawShape(t,e),this.drawIcon(t,e)},updateStatus:function(t,e){var i=null==e?void 0:e.getContainer().findById("status-image"),l=e.getContainer();if(!i&&t.status)this.drawStatus(t,l);else if(null==t?void 0:t.status)if(i.attr("img",Q[t.status]),t.status===p.Delete){i.attr("lineDash",[3,6])}else i.attr("lineDash",[]);else l.removeChild(i)},updateLabel:function(t,e){var i,l,n;if(t.label||""===t.label){var o=e.getContainer(),a=this.itemType+$,r=o.shapeMap[a]||o.find((function(t){return t.get("className")===a}));if(r){var s=H(null==t?void 0:t.label,110,null===(l=null===(i=null==t?void 0:t.labelCfg)||void 0===i?void 0:i.style)||void 0===l?void 0:l.fontSize),d=null===(n=t.labelCfg)||void 0===n?void 0:n.style,c=Object.assign({},d);null==r||r.attr(Object.assign(Object.assign({},c),{text:s,overflow:s!==(null==t?void 0:t.label)}))}else{var u=this.drawLabel(t,o);u.set("className",a),o.shapeMap[a]=u}}},updateIcon:function(t,e){if(t.icon){var i=e.getContainer(),l=i.findById("text-iconfont");if(l){var o=n.get(t,"iconStyle")||{};l.attr(Object.assign(Object.assign({},o),{text:F(t.icon),fontSize:18}))}else this.drawIcon(t,i)}}},"single-node")}var tt=function(){function t(t,i){var l=this;this.route=t,this.router=i,this.ctx="",this.value="",this.cacheLevelData=[],this.cacheRemoteData=[],this.nodeChildren={},this.remoteData={nodes:[],edges:[]},this.graph=null,this.timer=null,this.config={width:800,height:800},this.expandChart=!1,this.levelData=[],this.showExpand=!0,this.nodeClick=new e.EventEmitter,this.nodeDrillClick=new e.EventEmitter,this.nodeLinkClick=new e.EventEmitter,this.levelClick=new e.EventEmitter,this.expandChartChange=new e.EventEmitter,this.sizeChange=new e.EventEmitter,this.convertData={},this.maxChartWidth=460,this.maxWindowWidth=460,this.minChaertWidth=400,this.maxChartHeight=840,this.activeNode="",this.scrollChart=!1,this.tuopuRef=null,this.scrollLeftPx=100,this.lastCacheData={nodes:[],edges:[]},this.allNodesList=[],this.clickNodes=[],this.nodeWidth=52,this.initChart=function(){var t;return h.default.registerEdge("solid",{type:"line",afterDraw:function(t,e){var i=null==e?void 0:e.get("children")[0],l=T(t,null==t?void 0:t.status);i.attr(l)},setState:function(t,e,i){i._cfg.group.destroyed||R(t,e,i)}},"line"),h.default.registerEdge("solidCubic",{type:"line",afterDraw:function(t,e){var i=null==e?void 0:e.get("children")[0],l=T(t,null==t?void 0:t.status);i.attr(l)},setState:function(t,e,i){i._cfg.group.destroyed||R(t,e,i)}},"cubic-vertical"),function(){var t=[4,2,1,2];h.default.registerEdge("dashed",{afterDraw:function(e,i){(null==i?void 0:i.get("children")[0]).attr("lineDash",t)},setState:function(t,e,i){i._cfg.group.destroyed||R(t,e,i)}},"quadratic")}(),Z(l.handleClickNode.bind(l),l.handleHover.bind(l)),t=l.handleNodeDbClick,h.default.registerBehavior("click-add-edge",{getEvents:function(){return{"node:dblclick":"onClick",mousemove:"onMousemove","edge:dblclick":"onEdgeClick"}},onClick:function(e){t(e,this)},onMousemove:function(t){var e=this,i={x:t.x,y:t.y};e.addingEdge&&e.edge&&e.graph.updateItem(e.edge,{target:i})},onEdgeClick:function(t){var e=this,i=t.item;e.addingEdge&&e.edge===i&&(e.graph.removeItem(e.edge),e.edge=null,e.addingEdge=!1)}}),function(t){h.default.registerBehavior("click-add-node",{getEvents:function(){return{"canvas:dblclick":"onClick"}},onClick:function(e){t(e,this)}})}(l.handleCanvasDblclick),[]},this.handleCanvasDblclick=function(t,e){clearTimeout(l.timer);var i=e.graph,n=i.getNodes();i.addItem("node",{x:t.canvasX,fx:t.canvasX,y:t.canvasY,fy:t.canvasY,label:"node-"+n.length,id:"node-"+n.length})},this.handleNodeDbClick=function(t,e){clearTimeout(l.timer);var i=t.item,n=e.graph,o=i.getModel();e.addingEdge&&e.edge?(n.updateItem(e.edge,{target:o.id}),e.edge=null,e.addingEdge=!1):(e.edge=n.addItem("edge",{source:o.id,target:o.id}),e.addingEdge=!0)},this.initAction=function(t){t.on("node:mouseenter",(function(e){var i=e.item,l=i.getEdges();t.setItemState(i,p.Hover,!0);var n=i.getModel().id;l.forEach((function(e){var i=e.getSource(),l=e.getTarget();i&&l&&(null==t||t.setItemState(e,v.Running,!0),i._cfg.id!==n&&(null==t||t.setItemState(i,p.HoverNeighbor,!0)),l._cfg.id!==n&&(null==t||t.setItemState(l,p.HoverNeighbor,!0)))}))})),t.on("node:mouseleave",(function(e){var i=e.item,l=i.getEdges();null==t||t.setItemState(i,p.Hover,!1);var n=i.getModel().id;l.forEach((function(e){var i,l=e.getSource(),o=e.getTarget();l&&o&&(null==t||t.setItemState(e,v.Running,!1),l._cfg&&l._cfg.id!==n&&(null==t||t.setItemState(l,p.HoverNeighbor,!1)),o._cfg&&(null===(i=o._cfg)||void 0===i?void 0:i.id)!==n&&(null==t||t.setItemState(o,p.HoverNeighbor,!1)))}))})),t.on("node:click",(function(e){var i,o;e.stopPropagation();var a=e.item;console.log("node==>",a),l.activeNode=a._cfg.id;var r=null===(i=a._cfg)||void 0===i?void 0:i.model,s=t.findAllByState("node","click");(null===(o=r.children)||void 0===o?void 0:o.length)?l.clickNodes=s:(s.forEach((function(e){t.setItemState(e,"click",!1)})),r.count||t.setItemState(a,"click",!0),l.clickNodes=[a]),l.timer&&clearTimeout(l.timer),l.timer=n.delay((function(){r&&(r.count&&r.children?l.handleClickNode("count",r):(l.nodeClickLevel(r),l.nodeClick.emit(r)))}),300)}))},this._throttleScroll=n.throttle(this.throttleScroll.bind(this),100)}return t.prototype.ngOnInit=function(){this.posHandle(this.remoteData,this.levelData),this.drawCanvasChart(),this.tuopuRef=document.getElementById("scroll-tuopu")},t.prototype.ngOnDestroy=function(){this.baseGraph&&this.baseGraph.destroy()},t.prototype.getIconSrc=function(t,e,i){if(i)return e?"assets/images/topology/ceng_active.svg":"assets/images/topology/ceng.svg";var l=this.levelIconFind(t);return l?e?"assets/images/topology/"+l+"_active@2x.svg":"assets/images/topology/"+l+"@2x.svg":e?"assets/images/topology/layer_default_active@2x.svg":"assets/images/topology/layer_default@2x.svg"},t.prototype.throttleScroll=function(t){var e,i;console.log(t),this.scrollLeftPx=(null===(e=null==t?void 0:t.target)||void 0===e?void 0:e.scrollLeft)||100,(null===(i=null==t?void 0:t.target)||void 0===i?void 0:i.scrollLeft)<5?this.scrollChart=!1:this.scrollChart=!0},t.prototype.levelIconFind=function(t){return["layer_bizsystem","layer_application","layer_service","layer_container","layer_host","layer_network","layer_infra"].find((function(e){return e===t}))},t.prototype.levelActive=function(t,e){t.forEach((function(t){return t.selected=!1})),e.selected=!0,this.levelClick.emit(e);var i=250;this.expandChart&&(i=this.maxChartWidth<460?250+this.maxChartWidth:this.maxWindowWidth),this.scrollLeftPx=100,this.sizeChange.emit({width:i})},t.prototype.nodeClickLevel=function(t){var e=this.levelData.find((function(e,i){return i+1===t.level}));this.levelData.forEach((function(t){return t.selected=!1})),e.selected=!0},t.prototype.packLevel=function(){this.expandChart=!1;var t=250;this.expandChart&&(t=this.maxChartWidth<460?250+this.maxChartWidth:850),this.expandChartChange.emit(),this.scrollLeftPx=100,this.sizeChange.emit({width:t})},t.prototype.posHandle=function(t,e){var i=this;console.log("posHandle==>",t,e),this.convertData={};for(var l={},n=80,o=168,a=e.length,r=0,s=0;s<a;s++)this.convertData[s+1]=[];for(var d in t.nodes.forEach((function(t){e.forEach((function(e,i){t.code===e.code&&(t.level=i+1)})),i.convertData.hasOwnProperty(t.level)?i.convertData[t.level].push(t.child?50:n):i.convertData[t.level]=[n]})),this.convertData){var c=this.convertData[d].length?this.convertData[d].reduce((function(t,e){return t+e})):0;r=c>r?c:r}var u=r/2+36,h=(r-n)/2+2.4+50,g=(r+n)/2-n+50;for(var d in this.convertData)l[d]={total:this.convertData[d].length,list:this.convertData[d],multiple:parseInt(String(this.convertData[d].length/2),10),remainder:this.convertData[d].length%2};var f={},p=0;for(var d in console.log("XData",l,h,g),l){p++,f[d]=[];var v=l[d].list;if(0!==l[d].total)if(1!==l[d].total)if(2!==l[d].total){if(0===l[d].remainder){f[d][l[d].multiple-1]={x:h,y:o*p},f[d][l[d].multiple]={x:g+v[l[d].multiple],y:o*p};for(var m=l[d].multiple-1;m>0;m--)f[d][m-1]={x:f[d][m].x-v[m],y:o*p};for(m=l[d].multiple;m<l[d].total+1;m++)f[d][m]={x:f[d][m-1].x+v[m-1],y:o*p}}else{f[d][l[d].multiple]={x:u,y:o*p};for(m=l[d].multiple-1;m>=0;m--)f[d][m]={x:f[d][m+1].x-v[m],y:o*p};for(m=l[d].multiple+1;m<l[d].total+1;m++)f[d][m]={x:f[d][m-1].x+v[m],y:o*p}}console.log("remainder",l[d].remainder)}else{var y=g;g-h<n/3&&(y=g+n),f[d]=[{x:h,y:o*p},{x:y,y:o*p}]}else f[d]=[{x:u,y:o*p}]}this.maxChartWidth=r<220?this.minChaertWidth:r+230,this.maxChartHeight=o*p,t.nodes.forEach((function(t,e){for(var i in f)if(t.level==i){var l=f[i].splice(0,1);t.x=parseInt(l[0].x),t.y=parseInt(l[0].y)-100,t.icon=t.icon||"默认icon"}})),this.checkLink(t),console.log("dataNode data==> 节点信息:",t,"convertData",this.convertData)},t.prototype.changelineId=function(t,e,i,l){var n,o,a=null===(n=this.cacheRemoteData.edges)||void 0===n?void 0:n.find((function(t){return t.target===i.id})),r=null===(o=this.cacheRemoteData.edges)||void 0===o?void 0:o.find((function(t){return t.source===i.id}));if(a){var s=this.allNodesList.find((function(t){return t.id===a.source}));if(null==s?void 0:s.group)(d=e.find((function(t){return t.group===s.group&&!t.child})))&&t.push({source:d.id,target:l.id,style:{lineDash:[3]}})}if(r){var d,c=this.allNodesList.find((function(t){return t.id===r.target}));if(null==c?void 0:c.group)(d=e.find((function(t){return t.group===c.group&&!t.child})))&&t.push({source:l.id,target:d.id,style:{lineDash:[3]}})}},t.prototype.checkLink=function(t){var e=this,i=t.nodes,l=t.edges;i.map((function(t){var n;(null===(n=t.children)||void 0===n?void 0:n.length)?t.children.map((function(n){e.changelineId(l,i,n,t)})):e.changelineId(l,i,t,t)}));for(var n=function(t){var e=i.find((function(e){return e.id===l[t].target})),n=i.find((function(e){return e.id===l[t].source}));e&&n||l.splice(t,1)},o=l.length;o-- >0;)n(o);i.forEach((function(t){var e=i.filter((function(e){return e.code===t.code}));1===(null==e?void 0:e.length)&&(t.isLine=!0)})),l.forEach((function(t){var e=i.find((function(e){return e.id===t.target})),l=i.find((function(e){return e.id===t.source}));e.isLine&&l.isLine?t.type="solid":t.type="solidCubic"})),t.edges=u.default.uniqWith(l,(function(t,e){return t.target===e.target&&t.source===e.source||t.target===e.source&&t.source===e.target})),console.log("edges1",l)},t.prototype.onCanvasClick=function(){console.log("onCanvasClick")},t.prototype.onEditSave=function(t){console.log(t)},t.prototype.updateChartData=function(t,e,i,l,o){var a,r,s,d,c,u=this,h=t;i||(this.cacheLevelData=n.cloneDeep(e),this.cacheRemoteData=n.cloneDeep(t),this.allNodesList=[],this.nodeChildren={},null===(a=this.cacheRemoteData)||void 0===a||a.nodes.map((function(t){var e;(null===(e=t.children)||void 0===e?void 0:e.length)?t.children.map((function(t){u.allNodesList.push(t)})):u.allNodesList.push(t)})),this.lastCacheData=n.cloneDeep(t)),console.log("传进组件的原始数据",n.cloneDeep(h)),this.posHandle(h,e);var g={nodes:n.clone(t.nodes.map((function(t){return Object.assign(Object.assign({},t),{status:"",style:t.style||n.cloneDeep(j.defaultNode.style),stateStyles:t.stateStyles||n.cloneDeep(j.nodeStateStyles),iconStyle:t.iconStyle||n.cloneDeep(j.defaultNode.iconStyle),iconImageStyle:t.iconImageStyle||n.cloneDeep(j.defaultNode.iconImageStyle),countStyle:t.countStyle||n.cloneDeep(j.defaultNode.countStyle)})}))),edges:n.cloneDeep(t.edges.map((function(t){return Object.assign({},t)})))};if(console.log("this.maxChartWidth",this.maxChartWidth),console.log("this.maxChartHeight",this.maxChartHeight),console.log("resultData",g),null===(r=document.querySelector(".topo-content"))||void 0===r||(r.scrollLeft=0),null===(s=this.baseGraph)||void 0===s||s.changeData(g),null===(d=this.baseGraph)||void 0===d||d.changeSize(this.maxChartWidth,this.maxChartHeight),o){for(var f=[],p=0,v=0;v<e.length;v++)if(this.convertData[v+1].length){f=this.convertData[v+1],p=v;break}var m=this.nodeWidth*f.length;f.map((function(t){m+=t})),null===(c=this.baseGraph)||void 0===c||c.moveTo(this.maxChartWidth/2-m/2,59+168*p)}var y=.95*(this.containerWidth-250);this.maxChartWidth>460&&(this.maxWindowWidth=850),this.maxChartWidth>y&&(this.maxWindowWidth=y,this.tuopuRef.scrollTo({left:y/4}));var x=this.maxChartWidth<460?250+this.maxChartWidth:this.maxWindowWidth;this.sizeChange.emit({width:x,targetId:l})},t.prototype.drawCanvasChart=function(){var t=new h.default.Tooltip({itemTypes:["node"],offsetX:10,offsetY:10,fixToNode:[1,.5],getContent:function(t){return"<div class=topology_tooltip>"+t.item.getModel().label+"</div>"},shouldBegin:function(t){return"label"===t.target.cfg.name&&t.target.cfg.overflow}});this.baseGraph=new o.Graph(Object.assign(Object.assign(Object.assign({},j),this.config||{}),{container:"topo",modes:{default:[{type:"drag-canvas",direction:"x"}]},width:this.maxChartWidth,height:this.maxChartHeight,plugins:f([t],this.initChart())})),this.baseGraph.data(this.remoteData),this.baseGraph.render(),this.initAction(this.baseGraph),this.baseGraph.get("canvas").set("localRefresh",!1)},t.prototype.handleHover=function(t){console.log("item",t.getBBox());var e=t.getBBox().x,i=.95*(this.containerWidth-250),l=100===this.scrollLeftPx?0:this.scrollLeftPx;this.maxWindowWidth-e-250+l<=180&&(this.maxWindowWidth+=200,this.maxWindowWidth>=i&&(this.maxWindowWidth=i,this.scrollLeftPx+=150,this.tuopuRef.scrollTo({left:this.scrollLeftPx,behavior:"smooth"})),this.sizeChange.emit({width:this.maxWindowWidth}))},t.prototype.drawHulls=function(){var t=this;Object.keys(this.nodeChildren).map((function(e){var i,l=t.cacheRemoteData.nodes.find((function(t){return t.group===e})),n=l.alertNum>0?l.alertNum+"/"+l.count:""+l.count;t.baseGraph.createHull({id:"leafNode-hull_"+e,members:t.nodeChildren[e],padding:6,style:{lineDash:[3],fill:"transparent",stroke:"#000"}});var o=t.baseGraph.getHullById("leafNode-hull_"+e),a=o.group.getBBox(),r=7*n.length+6+8+8,s=null===(i=o.group)||void 0===i?void 0:i.addShape("rect",{attrs:Object.assign(Object.assign({},a),{x:a.x+a.width/2-r/2,y:a.y+a.height-5,width:r,height:16,fill:"#001A4F",radius:3,cursor:"pointer",lineWidth:0}),name:"hull-rect",id:"hull-rect_"+e,draggable:!0,zIndex:30,visible:!0});console.log("hideTextCount",a,n);var d=o.group.addShape("text",{attrs:{text:n,x:a.x+a.width/2,y:a.y+a.height-3,fontSize:12,cursor:"pointer",textAlign:"center",textBaseline:"top",fill:"#fff"},name:"hull-text",id:"hull-text_"+e,draggable:!0,zIndex:40,visible:!0}),c=o.group.addShape("polygon",{attrs:{points:[[a.x+a.width/2-r/2+8,a.y+a.height+3],[a.x+a.width/2-r/2+4,a.y+a.height-1],[a.x+a.width/2-r/2+4,a.y+a.height+7]],fill:"#fff",cursor:"pointer"},name:"marker-shape",id:"marker-shape_"+e,draggable:!0,zIndex:50,visible:!0}),u=o.group.addShape("polygon",{attrs:{points:[[a.x+a.width/2+r/2-8,a.y+a.height+3],[a.x+a.width/2+r/2-4,a.y+a.height-1],[a.x+a.width/2+r/2-4,a.y+a.height+7]],fill:"#fff",cursor:"pointer"},name:"marker-shape",id:"marker-shape_"+e,draggable:!0,zIndex:50,visible:!0});null==u||u.on("click",(function(e){e.stopPropagation(),t.handleHideCount(l)})),null==c||c.on("click",(function(e){e.stopPropagation(),t.handleHideCount(l)})),null==s||s.on("click",(function(e){e.stopPropagation(),t.handleHideCount(l)})),null==d||d.on("click",(function(e){e.stopPropagation(),t.handleHideCount(l)}))}))},t.prototype.handleHideCount=function(t){var e,i;console.log(t);var l=u.default.cloneDeep(this.lastCacheData);l.nodes=null===(e=l.nodes)||void 0===e?void 0:e.filter((function(e){return e.group!==t.group}));var n=null===(i=this.cacheRemoteData.nodes)||void 0===i?void 0:i.find((function(e){return e.group&&e.group===t.group&&e.code===t.code})),o=this.lastCacheData.nodes.findIndex((function(t){return t.group===n.group&&t.code===n.code&&t.child}));l.nodes.splice(o,0,n),this.nodeChildren[t.group]&&delete this.nodeChildren[t.group],this.lastCacheData=l,this.updateChartData(l,this.cacheLevelData,!0),this.restoreClickNodes(),u.default.isEmpty(this.nodeChildren)||this.drawHulls()},t.prototype.restoreClickNodes=function(){var t=this;this.clickNodes.forEach((function(e){var i;e&&!e.destroyed&&e._cfg&&(null===(i=t.baseGraph)||void 0===i||i.setItemState(e,"click",!0))}))},t.prototype.handleClickNode=function(t,e){if("count"===t){if(console.log("点击了统计",e),!e.children||!e.children.length)return;var i=this.recovertCount(e);console.log("111111",i),this.updateChartData(i,this.cacheLevelData,!0),this.restoreClickNodes(),this.baseGraph.removeHulls(),u.default.isEmpty(this.nodeChildren)||this.drawHulls()}else"url"===t?this.nodeLinkClick.emit(e):this.nodeDrillClick.emit(e)},t.prototype.recovertCount=function(t){var e,i,l,o=t.id,a=t.code,r=n.cloneDeep(this.lastCacheData),s=this.lastCacheData.nodes.filter((function(t){return t.code===a})),d={};if(s.map((function(t){t.group&&d[t.group]&&(l=t),t.group&&(d[t.group]=t)})),l){var c=null===(e=this.cacheRemoteData.nodes)||void 0===e?void 0:e.find((function(t){var e;return t.group===l.group&&(null===(e=t.children)||void 0===e?void 0:e.length)})),h=this.lastCacheData.nodes.findIndex((function(t){return t.group==c.group}));r.nodes=this.lastCacheData.nodes.filter((function(t){return t.group!==l.group})),r.nodes.splice(h,0,c),delete this.nodeChildren[c.group]}var g=null===(i=r.nodes.find((function(t){return t.id===o})))||void 0===i?void 0:i.children;this.nodeChildren[t.group]=g.map((function(t){return t.id}));var f=r.nodes.findIndex((function(t){return t.id===o})),p=r.nodes.slice(0,f),v=r.nodes.slice(f+1);return r.nodes=p.concat(g).concat(v),console.log("点击的数据==>",r.nodes),console.log("处理前",n.cloneDeep(r)),r.edges=u.default.cloneDeep(this.cacheRemoteData.edges),this.checkLink(r),console.log("处理后",n.cloneDeep(r.edges)),this.lastCacheData=r,r},t.prototype.setNodeState=function(t,e,i){var l=this;void 0===i&&(i=!1);var n=this.baseGraph.findAll("node",(function(t){return!0})),o=[];n.forEach((function(e){t.includes(e.getModel().id)&&o.push(e)})),o.forEach((function(t){l.baseGraph.setItemState(t,e,i)}))},t.prototype.setNodesHightLight=function(t){var e=this,i=this.baseGraph.findAll("node",(function(t){return!0})),l=[];i.forEach((function(e){t.includes(e.getModel().id)&&l.push(e)})),l.forEach((function(t){e.baseGraph.setItemState(t,"click",!0)}))},t.prototype.clearNodesHightLight=function(){var t=this;this.baseGraph.findAll("node",(function(t){return!0})).forEach((function(e){t.baseGraph.setItemState(e,"click",!1)}))},t}();tt.decorators=[{type:e.Component,args:[{selector:"app-level-topo",template:' <div class="topo-wrap" >\r\n <div class="topo-layer" id="topo-cus-wrap" [ngStyle]="expandChart ? { width: maxChartWidth < 460 ? 250 + maxChartWidth + \'px\' : maxWindowWidth + \'px\' } : { width: \'250px\' }">\r\n\x3c!-- <span nz-icon class="pack-icon" [nzType]="expandChart ? \'menu-fold\' : \'menu-unfold\'" nzTheme="outline" (click)="packLevel()"></span>--\x3e\r\n <span *ngIf="expandChart && showExpand" nz-icon class="pack-icon" [nzType]="expandChart ? \'double-left\' : \'double-right\'" nzTheme="outline" (click)="packLevel()"></span>\r\n <div class="topo-left">\r\n <section *ngFor="let level of levelData; let i = index"\r\n [ngClass]="{ \'level-c\': level.selected}"\r\n (click)="levelActive(levelData, level)"\r\n >\r\n <div class="level-title">\r\n\x3c!-- <i class="iconfont mr8" [ngClass]="[levelIconFind(level.icon) ? \'icon\' + level.icon : \'iconlayer_default\']"></i>--\x3e\r\n <img style="width: 25px;" [src]="getIconSrc(level.icon, level.selected)">\r\n <span nz-tooltip [nzTooltipTitle]="level.name">{{ level.name | textMiddleEllipsis: 5 }}</span>\r\n </div>\r\n <div class="level-content">\r\n\x3c!-- <i class="iconfont iconceng_xuanzhong1"></i>--\x3e\r\n <img class="level-grade-img" [src]="getIconSrc(level.icon, level.selected, \'level\')">\r\n <div class="level-grade">\r\n <span class="red" *ngIf="level.alertCount > 0">{{level.alertCount}}</span>\r\n <span>{{level.instanceCount || 0}}</span>\r\n </div>\r\n </div>\r\n </section>\r\n <div class="left-box-shadow" [ngStyle]="scrollChart ? {display: \'block\'} : {display:\'none\'}"></div>\r\n </div>\r\n <div class="topo-content scroll-x"\r\n id="scroll-tuopu"\r\n (scroll)="_throttleScroll($event)"\r\n >\r\n <div id="topo"></div>\r\n </div>\r\n\r\n </div>\r\n </div>\r\n',styles:['#topo-cus-wrap,.topo-layer{position:relative}.topo-layer{width:100%}.topo-layer .red{color:red}.topo-layer .topo-left{position:relative}.topo-layer .topo-left section{background:#f9f9f9;height:168px;align-items:center;display:flex;flex-wrap:wrap;padding-left:34px;border-left:4px solid transparent;cursor:pointer}.topo-layer .topo-left section:nth-child(2n){background:#fff}.topo-layer .topo-left .left-box-shadow{display:none;position:absolute;top:0;bottom:0;left:0;box-shadow:6px 0 8px 0 rgba(0,0,0,.05);width:250px;pointer-events:none}.topo-layer .topo-left .level-title{flex:100%;align-self:flex-end;margin-top:8px}.topo-layer .topo-left .level-title span{font-size:16px;padding-left:14px}.topo-layer .topo-left .level-title .iconfont{font-size:14px;color:#3e425b}.topo-layer .topo-left .level-content{align-self:flex-start}.topo-layer .topo-left .level-content .iconceng_xuanzhong1{color:rgba(181,191,218,.5)}.topo-layer .pack-icon{position:absolute;top:17px;right:24px;cursor:pointer;z-index:9}.topo-layer .topo-content{position:absolute;width:calc(100% - 250px);top:0;right:0;bottom:0}.topo-layer .level-grade-img{scale:1;position:relative;left:-6px}.topo-layer .level-grade{position:relative;top:-16px;left:74px;width:100px;text-align:right}.topo-layer .level-grade .red:after{content:"/";margin:0 5px;color:#000}.topo-layer .level-c{border-left:4px solid #4686e9!important}.topo-layer .level-c .iconfont,.topo-layer .level-c .level-title{color:#4686e9!important}.topo-layer .level-c .iconceng{color:#4686e9}.scroll-x{overflow-x:auto;overflow-y:hidden}.scroll-x::-webkit-scrollbar-track{background:transparent}.scroll-x::-webkit-scrollbar{width:8px;height:8px;background:transparent;border-radius:5px}.scroll-x::-webkit-scrollbar-thumb{background-color:hsla(0,0%,100%,0);border-radius:2px!important}.scroll-x::-webkit-scrollbar-thumb:hover{background-color:rgba(0,0,0,.6)}']}]}],tt.ctorParameters=function(){return[{type:l.ActivatedRoute},{type:l.Router}]},tt.propDecorators={levelData:[{type:e.Input}],showExpand:[{type:e.Input}],containerWidth:[{type:e.Input}],nodeClick:[{type:e.Output}],nodeDrillClick:[{type:e.Output}],nodeLinkClick:[{type:e.Output}],levelClick:[{type:e.Output}],expandChartChange:[{type:e.Output}],sizeChange:[{type:e.Output}]};var et=function(){function t(){}return t.prototype.transform=function(t,e){if(e||(e=10),t&&t.length>2*e){return t.substring(0,e)+"..."+t.slice(-Math.floor(e/2))}return t},t}();et.decorators=[{type:e.Pipe,args:[{name:"textMiddleEllipsis"}]}];var it=function(){};it.decorators=[{type:e.NgModule,args:[{declarations:[et],exports:[et,r.TranslateModule]}]}];var lt=function(){};lt.decorators=[{type:e.NgModule,args:[{declarations:[tt],imports:[i.CommonModule,s.NzToolTipModule,d.NzIconModule,it],exports:[tt]}]}],t.MetricTopoChartComponent=tt,t.MetricTopoChartModule=lt,t["ɵa"]=it,t["ɵb"]=et,Object.defineProperty(t,"__esModule",{value:!0})}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@angular/common"),require("@angular/router"),require("lodash"),require("@antv/g6"),require("@antv/util"),require("@ngx-translate/core"),require("ng-zorro-antd/tooltip"),require("ng-zorro-antd/icon")):"function"==typeof define&&define.amd?define("webcmp-topo-chart-vertical",["exports","@angular/core","@angular/common","@angular/router","lodash","@antv/g6","@antv/util","@ngx-translate/core","ng-zorro-antd/tooltip","ng-zorro-antd/icon"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["webcmp-topo-chart-vertical"]={},t.ng.core,t.ng.common,t.ng.router,t._,t.G6,t.util,t.core$1,t.tooltip,t.icon)}(this,(function(t,e,i,l,n,o,a,r,s,d){"use strict";function c(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var u=c(n),h=c(o);Object.create;function g(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var l,n,o=i.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(l=o.next()).done;)a.push(l.value)}catch(t){n={error:t}}finally{try{l&&!l.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return a}function f(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(g(arguments[e]));return t}var p,v,m,y,x,b,S,k,C;Object.create;!function(t){t.Add="add",t.Delete="delete",t.Update="update",t.Match="match",t.Hover="hover",t.Neighbor="neighbor",t.Selected="select",t.Click="click",t.Active="active",t.HoverNeighbor="hoverNeighbor"}(p||(p={})),function(t){t.Running="running",t.Selected="select"}(v||(v={})),function(t){t.Solid="solid",t.Dashed="dashed"}(m||(m={})),function(t){t.Edit="edit",t.Compare="compare",t.Default="default"}(y||(y={})),function(t){t.SOLID="solid",t.DASHED="dashed",t.DOTTED="dotted"}(x||(x={}));var w="#fff",D=w,I="#3E425B",W="#DDDDDD",O="#3370ff",z="#4881F6",N="#8753F6",E="#3479E8",L="#548CFF",B="#EEF3FE",_="#3479E8",j={modes:(b={},b[y.Default]=["activate-relations","click-select"],b[y.Edit]=["drag-canvas","drag-node","activate-relations","click-add-node","click-select","click-add-edge"],b[y.Compare]=["drag-canvas","drag-node","activate-relations","click-select"],b),defaultNode:{type:"custom-circle-left",size:42,draggable:!0,outerCircleStyle:{r:26},iconStyle:{fill:I,fontSize:12,fontFamily:"iconfont",textAlign:"center",textBaseline:"middle",cursor:"pointer"},iconImageStyle:{width:15,height:15,cursor:"pointer"},countStyle:{fill:"#16181D",label:{fill:"#fff"}},style:{lineWidth:1,stroke:I,fill:D,r:21,zIndex:2,cursor:"pointer"},labelCfg:{fontWeight:400,style:{fill:w,textAlign:"left",fontSize:12,cursor:"pointer",textBaseline:"middle"}}},nodeStateStyles:(S={},S[p.Neighbor]={lineWidth:2,stroke:E,fill:D},S[p.Hover]=(k={lineWidth:2,stroke:w,fill:L,icon:{stroke:w,fill:w},link:{stroke:z,fill:z}},k[p.Match]={lineWidth:1,stroke:N,fill:D},k),S[p.Selected]={lineWidth:2,stroke:E,fill:L,icon:{stroke:E,fill:D}},S[p.Neighbor]={lineWidth:2,stroke:_,fill:B,icon:{stroke:E,fill:_}},S[p.HoverNeighbor]={lineWidth:2,stroke:_,fill:B,icon:{stroke:E,fill:_}},S),defaultEdge:{type:"solid",size:1,draggable:!0,color:W,style:{zIndex:1}},edgeStateStyles:(C={},C[v.Running]={stroke:O},C[v.Selected]={stroke:O},C)};function T(t,e){var i=t.style;if(!e)return i;var l=i[e];return Object.assign(Object.assign({},i),l)}function H(t,e,i){var l=h.default.Util.getTextSize("...",i)[0],n=0,o=t,a=new RegExp("[一-龥]+");return null==t||t.split("").forEach((function(r,s){n>e-l||(a.test(r)?n+=i:n+=h.default.Util.getLetterWidth(r,i),n>e-l&&(o=t.substr(0,s)+"..."))})),o}var M=h.default.Util,P=M.getLabelPosition,A=M.transform;function R(t,e,i){var l,n=null===(l=null==i?void 0:i._cfg)||void 0===l?void 0:l.group,o=null==n?void 0:n.findById("marker"),a=null==i?void 0:i.get("keyShape"),r=i.getStates();if(t!==v.Selected&&t!==v.Running||!e||o||(o=null==n?void 0:n.addShape("marker",{id:"marker",attrs:{x:16,y:0,r:8,lineWidth:2,stroke:a.cfg.attrs[v.Running].stroke,symbol:function(t,e){return[]}}})),r.includes(v.Selected)){var s=i.getStateStyle(v.Selected);a.attr("stroke",s.stroke);var d=a.getPoint(.5);P(a,.5);o.attr({x:d.x,y:d.y}),o.stopAnimate()}else if(t!==v.Selected||e){if(t===v.Running){a.cfg.running=e;s=T(i._cfg.model,i._cfg.model.status);if(e){var c=T(i._cfg.model,v.Running);null==o||o.animate((function(t){var e=a.getPoint(t),i=P(a,t),l=[1,0,0,0,1,0,0,0,1];return l=A(l,[["t",-e.x,-e.y],["r",i.angle],["t",e.x,e.y]]),{x:e.x,y:e.y}}),{duration:1e3}),a.attr("stroke",c.stroke)}else a.attr("stroke",s.stroke||W),null==o||o.resetMatrix(),null==o||o.stopAnimate(),null==o||o.hide()}}else{var u=T(i._cfg.model);a.attr("endArrow",!1),a.attr("stroke",u.stroke),o.hide()}}var G,q=require("../static/icons/iconfont.json");function F(t){var e=q.glyphs.map((function(t){return{name:t.name,unicode:String.fromCodePoint(t.unicode_decimal)}})),i=e.find((function(e){return e.name===t}))||{unicode:String.fromCodePoint(59036),name:"asset_default"};return i.unicode}var X=require("../../../../../assets/images/drill.svg"),U=require("../../../../../assets/images/add.svg"),V=require("../../../../../assets/images/delete.svg"),Y=require("../../../../../assets/images/update.svg"),K=require("../../../../../assets/images/view.svg"),$="-label",J=[3,6],Q=((G={})[p.Add]=U,G[p.Delete]=V,G[p.Update]=Y,G);p.Add,p.Delete,p.Update;function Z(t,e){h.default.registerNode("custom-circle-left",{drawLabelType:function(t,e,i){var l,n,o,a,r=(this.mergeStyle||this.getOptions(t)||{}).labelCfg||{},s=this.getLabelStyle(t,r,e),d=this.getShapeStyle(t,null==t?void 0:t.status),c=H(null==t?void 0:t.targetTypeName,110,null===(n=null===(l=null==t?void 0:t.labelCfg)||void 0===l?void 0:l.style)||void 0===n?void 0:n.fontSize),u=null==e?void 0:e.addShape("text",{attrs:Object.assign(Object.assign({},s),{text:c,x:d.r+18,y:30-d.r,fontSize:null===(a=null===(o=null==t?void 0:t.labelCfg)||void 0===o?void 0:o.style)||void 0===a?void 0:a.fontSize}),draggable:!0,id:i||"targettype",zIndex:5,visible:!1,name:i||"targettype",overflow:c!==(null==t?void 0:t.targetType)});return console.log("targetType",t.targetType),u},drawLabel:function(t,e,i){var l,n,o,a,r=(this.mergeStyle||this.getOptions(t)||{}).labelCfg||{},s=this.getLabelStyle(t,r,e),d=this.getShapeStyle(t,null==t?void 0:t.status),c=H(null==t?void 0:t.label,110,null===(n=null===(l=null==t?void 0:t.labelCfg)||void 0===l?void 0:l.style)||void 0===n?void 0:n.fontSize),u=Object.assign(Object.assign({},s),{text:c,x:d.r+18,y:10-d.r,fontSize:null===(a=null===(o=null==t?void 0:t.labelCfg)||void 0===o?void 0:o.style)||void 0===a?void 0:a.fontSize});return(null==t?void 0:t.count)&&(u.y=0),null==e?void 0:e.addShape("text",{attrs:u,draggable:!0,id:i||"label",zIndex:3,visible:!1,name:i||"label",overflow:c!==(null==t?void 0:t.label)})},drawText:function(t,e,i,l,n,o,a){var r,s,d=(this.mergeStyle||this.getOptions(t)||{}).labelCfg||{},c=this.getLabelStyle(t,d,e);return null==e?void 0:e.addShape("text",{attrs:Object.assign(Object.assign({},c),{text:i,x:n,fontSize:null===(s=null===(r=null==t?void 0:t.labelCfg)||void 0===r?void 0:r.style)||void 0===s?void 0:s.fontSize,fill:o?N:c.fill,visible:!1}),draggable:!0,id:"text_"+a,zIndex:3,name:"label",overflow:l,visible:!1})},drawStatus:function(t,e){var i=this.getShapeStyle(t,null==t?void 0:t.status);return e.addShape("image",{attrs:{img:Q[t.status],y:-i.r-8,x:10},zIndex:3,draggable:!0,name:"status-image",id:"status-image"})},drawShape:function(t,e,i){var l=this.getShapeStyle(t),n=l.stroke,o=function(t,e){var i={};for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&e.indexOf(l)<0&&(i[l]=t[l]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(l=Object.getOwnPropertySymbols(t);n<l.length;n++)e.indexOf(l[n])<0&&Object.prototype.propertyIsEnumerable.call(t,l[n])&&(i[l[n]]=t[l[n]])}return i}(l,["stroke"]);t.count&&t.children&&(o.r=o.r+5);var a=e.addShape("circle",{attrs:Object.assign(Object.assign({},o),{stroke:n}),name:i||"inner-circle",id:i||"inner-circle",draggable:!0,zIndex:i?4:3});return console.log("circle",o),a},drawIcon:function(t,e,i){var l,o=t.icon,a=this.getShapeStyle(t,null==t?void 0:t.status);if(/^http/.test(l=o)||/^blob:http/.test(l)||/^data:image\/.*;base64/.test(l)){var r=n.get(t,"iconImageStyle")||{};e.addShape("image",{attrs:Object.assign(Object.assign({},r),{img:t.icon,x:-a.r/2,y:-a.r/2}),zIndex:i?5:4,draggable:!0,name:i?"icon-image-active":"icon-image",id:i?"icon-image-active":"icon-image"})}else{(r=n.get(t,"iconStyle")||{}).fill=i||t.isAlert?"#FFF":r.fill,e.addShape("text",{attrs:Object.assign(Object.assign({},r),{text:F(t.icon),fontSize:18}),zIndex:i?5:4,draggable:!0,name:i?"text-iconfont-active":"text-iconfont",id:i?"text-iconfont-active":"text-iconfont"})}},drawOuterCircleShape:function(t,e,i){var l=this.getShapeStyle(t,null==t?void 0:t.status),n=null==e?void 0:e.addShape("circle",{attrs:Object.assign(Object.assign({},l),{r:l.r+8,lineWidth:2,fill:w,visibility:"hidden"}),name:i||"outer-circle",id:i||"outer-circle",draggable:!0,zIndex:2});return t.status===p.Delete&&n.attr("lineDash",J),n},drawOuterRectShape:function(t,e,i){var l,n=this.getShapeStyle(t);null===(l=e.findById("label"))||void 0===l||l.getBBox().maxX;return null==e?void 0:e.addShape("rect",{attrs:Object.assign(Object.assign({},n),{width:160,height:2*(n.r+8)+1,y:-(n.r+8+.5)}),name:i||"outer-rect",id:i||"outer-rect",draggable:!0,zIndex:1})},drawCountContainer:function(t,e,i){var l=this.getShapeStyle(t);return null==e?void 0:e.addShape("rect",{attrs:Object.assign(Object.assign({},l),{width:160,height:2*(l.r+5),y:-(l.r+5+2),radius:[0,17,4,0]}),name:i||"count-container",id:i||"count-container",draggable:!0,zIndex:1})},drawImageLink:function(e,i,l){var n=this.getShapeStyle(e,null==e?void 0:e.status),o=(i.findById("label").getBBox().maxX,null==i?void 0:i.addShape("image",{attrs:{x:171,y:4-n.r,cursor:"pointer",img:X,width:12,height:12},name:l||"image-drill",draggable:!0,zIndex:5,id:l||"image-drill",visible:!1}));return null==o||o.on("mouseenter",(function(t){t.stopPropagation(),o.attr("width",14),o.attr("height",14)})),null==o||o.on("mouseleave",(function(t){t.stopPropagation(),o.attr("width",12),o.attr("height",12)})),null==o||o.on("click",(function(i){i.stopPropagation(),t("url",e)})),o},drawImageView:function(e,i,l){var n=this.getShapeStyle(e,null==e?void 0:e.status),o=(i.findById("label").getBBox().maxX,null==i?void 0:i.addShape("image",{attrs:{x:170,y:e.showLink?n.r-16:n.r-28,cursor:"pointer",img:K,width:14,height:14},name:l||"image-view",draggable:!0,zIndex:8,id:l||"image-view",visible:!1}));return null==o||o.on("mouseenter",(function(t){t.stopPropagation(),o.attr("x",169),o.attr("width",16),o.attr("height",16)})),null==o||o.on("mouseleave",(function(t){t.stopPropagation(),o.attr("x",170),o.attr("width",14),o.attr("height",14)})),null==o||o.on("click",(function(i){i.stopPropagation(),console.log("image",e),t("drill",e)})),o},drawOuterLinkShape:function(t,e,i){var l,n=this.getShapeStyle(t);null===(l=e.findById("label"))||void 0===l||l.getBBox().maxX;return null==e?void 0:e.addShape("rect",{attrs:Object.assign(Object.assign({},n),{width:33,height:2*(n.r+8+.5),y:-(n.r+8+.5),x:160,fill:z,stroke:z,radius:[0,17,4,0]}),name:i||"outer-link",id:i||"outer-link",draggable:!0,zIndex:1,visible:!1})},drawCount:function(e,i){var l=this.getShapeStyle(e),o=(n.toString(e.count),null==i?void 0:i.findById("count-rect")),a=null==i?void 0:i.findById("count-rect-text");if(o&&(null==i||i.removeChild(o),null==i||i.removeChild(a)),e.count){console.log("group",e,l,i);var r=e.countStyle,s=e.alertNum?e.alertNum+"/"+e.count:""+e.count,d=7*s.length+6+8+8;e.children||(d-=8);var c=null==i?void 0:i.addShape("rect",{attrs:Object.assign(Object.assign({},l),{width:d,height:16,x:-d/2,y:l.r-6,fill:"#001A4F",radius:3,lineWidth:0}),name:"count-rect",id:"count-rect",draggable:!0,zIndex:20,visible:!0});if(e.children)i.addShape("polygon",{attrs:{points:[[-d/2+4,l.r+2],[-d/2+8,l.r+6],[-d/2+8,l.r-2]],fill:"#fff",cursor:"pointer"},name:"marker-shape",id:"marker-shape-left",draggable:!0,zIndex:50,visible:!0}),i.addShape("polygon",{attrs:{points:[[d/2-4,l.r+2],[d/2-8,l.r+6],[d/2-8,l.r-2]],fill:"#fff",cursor:"pointer"},name:"marker-shape",id:"marker-shape-left",draggable:!0,zIndex:50,visible:!0});var u=null==i?void 0:i.addShape("text",{attrs:{text:s,y:l.r-4,fontSize:12,textAlign:"center",textBaseline:"top",width:d,fill:r.label.fill},name:"count-rect-text",id:"count-rect-text",draggable:!0,zIndex:20,visible:!0});null==c||c.on("click",(function(i){i.stopPropagation(),t("count",e)})),null==u||u.on("click",(function(i){i.stopPropagation(),t("count",e)}))}},getShapeStyle:function(t,e){var i=t.style;if(!e)return i;var l=i[e];return Object.assign(Object.assign({},i),l)},draw:function(t,e){var i=this.drawShape(t,e),l=this.drawOuterCircleShape(t,e);if(null==t?void 0:t.label){var n=this.drawLabel(t,e);n.set("className",this.itemType+$),e.shapeMap[this.itemType+$]=n}if((null==t?void 0:t.targetType)&&!(null==t?void 0:t.count)&&this.drawLabelType(t,e),t.showLink&&this.drawImageLink(t,e),t.hideView||this.drawImageView(t,e),(null==t?void 0:t.status)&&this.drawStatus(t,e),t.icon&&this.drawIcon(t,e),t.count&&(this.drawCount(t,e),t.children)){var o=this.drawCountContainer(t,e);null==o||o.hide()}t.status||null==l||l.hide();var a=this.drawOuterRectShape(t,e);return this.drawOuterLinkShape(t,e),null==a||a.hide(),null==e||e.sort(),i},setState:function(t,i,l){if(!l._cfg.group.destroyed){var o=null==l?void 0:l.getContainer().findById("outer-circle"),a=l.getContainer().findById("count-container"),r=null==l?void 0:l.getContainer().findById("outer-rect"),s=null==l?void 0:l.getContainer().findById("image-drill"),d=null==l?void 0:l.getContainer().findById("image-view"),c=null==l?void 0:l.getContainer().findById("label"),u=null==l?void 0:l.getContainer().findById("targettype"),h=l.getStates(),g=l.getKeyShape(),f=l.getContainer().findById("text-iconfont"),v=l.getContainer().findById("outer-link"),m=null==l?void 0:l.getContainer().findById("text_0"),y=null==l?void 0:l.getContainer().findById("text_1"),x=null==l?void 0:l.getContainer().findById("text_2"),b=null==l?void 0:l.getContainer().findById("count-rect"),S=(null==l||l.getContainer().findById("count-rect-text"),null==l?void 0:l.getContainer().findById("inner-circle")),k=l.getModel(),C=null==k?void 0:k.isAlert,D=l._cfg.group,I=l.getStateStyle(p.Hover)||j.nodeStateStyles.hover,W=(n.get(I,"icon")||j.nodeStateStyles.hover.icon,null==b||b.getBBox(),this.getShapeStyle(k));if("hover"===t)if(i){var O=(H=I).link||{};l.toFront(),null==o||o.show(),null==r||r.show(),null==s||s.show(),null==c||c.show(),null==u||u.show(),null==d||d.show(),null==v||v.show(),null==m||m.show(),null==y||y.show(),null==x||x.show(),console.log("hoverItem",l.getModel(),l),null==c||c.attr("fill",H.stroke),null==c||c.attr("textAlign","left"),null==u||u.attr("fill",H.stroke),null==u||u.attr("textAlign","left"),r.attr("fill",H.fill),r.attr("stroke",H.fill),null==a||a.attr("fill",H.fill),null==a||a.attr("stroke",H.fill),o.attr("stroke",H.fill),o.attr("lineDash",void 0),o.attr("lineWidth",H.lineWidth),g.attr("fill",H.fill),g.attr("stroke",H.fill),null==f||f.attr("fill",w),v.attr("fill",O.fill),v.attr("stroke",O.stroke),console.log("cfg",k.hasChildren),k.count&&k.children?(null==a||a.show(),console.log(o.getBBox(),W),o.attr("r",W.r+7),null==r||r.hide(),null==v||v.hide()):(null==a||a.hide(),o.attr("r",W.r+8),null==r||r.show(),null==v||v.show()),e(l)}else{var B=this.getShapeStyle(k);g.attr("fill",B.fill),g.attr("stroke",B.stroke),o.attr("stroke",B.stroke),k.status||null==o||o.hide(),o.attr("stroke",B.stroke),k.status===p.Delete&&o.attr("lineDash",J);var _=n.get(k,"iconStyle")||{};null==f||f.attr("fill",_.fill),null==r||r.hide(),null==s||s.hide(),null==d||d.hide(),null==c||c.hide(),null==u||u.hide(),v.hide(),null==m||m.hide(),null==y||y.hide(),null==x||x.hide(),null==a||a.hide()}if(t===p.Selected&&!i){B=this.getShapeStyle(k);g.attr("fill",B.fill),o.attr("stroke",B.fill),o.attr("lineWidth",B.lineWidth),null==o||o.hide()}if(t===p.Click&&!i){B=this.getShapeStyle(k);g.attr("fill",B.fill),g.attr("stroke",B.stroke),o.attr("stroke",B.stroke),o.attr("lineWidth",B.lineWidth),k.status||null==o||o.hide(),o.attr("stroke",B.stroke),o.attr("lineWidth",B.lineWidth),k.status===p.Delete&&o.attr("lineDash",J);var T=n.get(k,"iconStyle")||{};null==f||f.attr("fill",T.fill),null==r||r.hide(),null==s||s.hide(),null==d||d.hide(),null==c||c.hide(),null==u||u.hide(),v.hide(),null==m||m.hide(),null==y||y.hide(),null==x||x.hide()}if((t===p.Neighbor||t===p.Match||t===p.HoverNeighbor)&&!i){var H=I,M=(B=this.getShapeStyle(k),k.iconStyle||j.defaultNode.iconStyle);g.attr("fill",B.fill),g.attr("stroke",B.stroke),null==f||f.attr("fill",M.fill)}if(t===p.Match&&!i){B=this.getShapeStyle(k);m&&D.removeChild(m),y&&D.removeChild(y),x&&D.removeChild(x),g.attr("stroke",B.stroke)}if(h.includes(p.HoverNeighbor)){H=l.getStateStyle(p.HoverNeighbor)||j.nodeStateStyles.hoverNeighbor;var P=n.get(H,"icon")||j[p.HoverNeighbor].icon;g.attr("fill",H.fill),g.attr("stroke",H.stroke),o.attr("stroke",H.fill),null==f||f.attr("fill",P.stroke)}if(h.includes(p.Neighbor)){H=l.getStateStyle(p.Neighbor)||j.nodeStateStyles[p.Neighbor];var A=n.get(H,"icon")||j[p.Neighbor].icon;if(C){var R=I;g.attr("fill",R.fill),g.attr("stroke",R.fill),o.attr("stroke",R.fill),o.attr("lineWidth",R.lineWidth),null==f||f.attr("fill",w)}else g.attr("fill",H.fill),g.attr("stroke",H.stroke),o.attr("stroke",H.fill),o.attr("lineWidth",H.lineWidth),null==f||f.attr("fill",A.stroke)}if(h.includes(p.Selected)){H=l.getStateStyle(p.Selected)||j.nodeStateStyles.select;g.attr("fill",H.fill),o.attr("stroke",H.fill),o.attr("lineWidth",H.lineWidth),null==o||o.show()}if(h.includes(p.Click)){O=(H=I).link||{};C||(H.stroke=w,H.fill=L,O.fill=z),l.toFront(),k.count&&k.children||null==o||o.show(),k.hideRect||(null==r||r.show(),null==v||v.show(),null==s||s.show(),null==c||c.show()),null==u||u.show(),null==d||d.show(),null==m||m.show(),null==y||y.show(),null==x||x.show(),null==c||c.attr("fill",H.stroke),null==c||c.attr("textAlign","left"),null==u||u.attr("fill",H.stroke),null==u||u.attr("textAlign","left"),r.attr("fill",H.fill),r.attr("stroke",H.fill),null==o||o.attr("stroke",H.fill),null==o||o.attr("lineDash",void 0),null==o||o.attr("lineWidth",H.lineWidth),g.attr("fill",H.fill),g.attr("stroke",H.fill),null==f||f.attr("fill",w),v.attr("fill",O.fill),v.attr("stroke",O.stroke)}if(h.includes(p.Match)){var G=l.getModel();H=I[p.Match]||j.nodeStateStyles.hover.match;g.attr("stroke",H.stroke);var q=l._cfg.prefix;if(q){var F=c.cfg.attrs.text,X=F.toLowerCase().indexOf(q.toLowerCase());c.hide(),null==u||u.hide();var U=X>0?F.substring(0,X):F.substring(0,X+q.length),V=X>0?F.substring(X,X+q.length):F.substring(X+q.length),Y=X>0?F.substring(X+q.length):"",K=this.getShapeStyle(G);if(U&&(m||(m=this.drawText(G,D,U,!0,K.r+10,U.toLowerCase()===q.toLowerCase(),0))),V&&!y){var $=K.r+10;m&&($=m.getBBox().maxX+1),y=this.drawText(G,D,V,!0,$,V.toLowerCase()===q.toLowerCase(),1)}if(Y&&!x){$=K.r+10;y&&($=y.getBBox().maxX+1),this.drawText(G,D,Y,!0,$,Y.toLowerCase()===q.toLowerCase(),2)}}}t===p.Match&&i&&(S.attr("stroke",N),S.attr("lineWidth",2)),t!==p.Match||i||(S.attr("stroke",E),S.attr("lineWidth",1))}},update:function(t,e,i){this.updateLabel(t,e,i),this.updateIcon(t,e,i),this.updateShapeStyle(t,e,i),this.updateStatus(t,e,i)},updateShapeStyle:function(t,e){var i,l=e.getContainer(),n=e.getKeyShape(),o=this.getShapeStyle(t);this.drawCount(t,l);var r=function(e){var r,s,d=o[e];if(a.isPlainObject(d)){var c=(null===(i=l.shapeMap)||void 0===i?void 0:i[e])||l.find((function(t){return t.get("name")===e}));null==c||c.attr(d)}else t.count&&t.children&&"r"===e?n.attr(((r={})[e]=d+5,r)):n.attr(((s={})[e]=d,s))};for(var s in o)r(s)},updateInCircleShape:function(t,e){this.drawShape(t,e),this.drawIcon(t,e)},updateStatus:function(t,e){var i=null==e?void 0:e.getContainer().findById("status-image"),l=e.getContainer();if(!i&&t.status)this.drawStatus(t,l);else if(null==t?void 0:t.status)if(i.attr("img",Q[t.status]),t.status===p.Delete){i.attr("lineDash",[3,6])}else i.attr("lineDash",[]);else l.removeChild(i)},updateLabel:function(t,e){var i,l,n;if(t.label||""===t.label){var o=e.getContainer(),a=this.itemType+$,r=o.shapeMap[a]||o.find((function(t){return t.get("className")===a}));if(r){var s=H(null==t?void 0:t.label,110,null===(l=null===(i=null==t?void 0:t.labelCfg)||void 0===i?void 0:i.style)||void 0===l?void 0:l.fontSize),d=null===(n=t.labelCfg)||void 0===n?void 0:n.style,c=Object.assign({},d);null==r||r.attr(Object.assign(Object.assign({},c),{text:s,overflow:s!==(null==t?void 0:t.label)}))}else{var u=this.drawLabel(t,o);u.set("className",a),o.shapeMap[a]=u}}},updateIcon:function(t,e){if(t.icon){var i=e.getContainer(),l=i.findById("text-iconfont");if(l){var o=n.get(t,"iconStyle")||{};l.attr(Object.assign(Object.assign({},o),{text:F(t.icon),fontSize:18}))}else this.drawIcon(t,i)}}},"single-node")}var tt=function(){function t(t,i){var l=this;this.route=t,this.router=i,this.ctx="",this.value="",this.cacheLevelData=[],this.cacheRemoteData=[],this.nodeChildren={},this.remoteData={nodes:[],edges:[]},this.graph=null,this.timer=null,this.config={width:800,height:800},this.expandChart=!1,this.levelData=[],this.showExpand=!0,this.nodeClick=new e.EventEmitter,this.nodeDrillClick=new e.EventEmitter,this.nodeLinkClick=new e.EventEmitter,this.levelClick=new e.EventEmitter,this.expandChartChange=new e.EventEmitter,this.sizeChange=new e.EventEmitter,this.convertData={},this.maxChartWidth=460,this.maxWindowWidth=460,this.minChaertWidth=400,this.maxChartHeight=840,this.activeNode="",this.scrollChart=!1,this.tuopuRef=null,this.scrollLeftPx=100,this.lastCacheData={nodes:[],edges:[]},this.allNodesList=[],this.clickNodes=[],this.nodeWidth=52,this.initChart=function(){var t;return h.default.registerEdge("solid",{type:"line",afterDraw:function(t,e){var i=null==e?void 0:e.get("children")[0],l=T(t,null==t?void 0:t.status);i.attr(l)},setState:function(t,e,i){i._cfg.group.destroyed||R(t,e,i)}},"line"),h.default.registerEdge("solidCubic",{type:"line",afterDraw:function(t,e){var i=null==e?void 0:e.get("children")[0],l=T(t,null==t?void 0:t.status);i.attr(l)},setState:function(t,e,i){i._cfg.group.destroyed||R(t,e,i)}},"cubic-vertical"),function(){var t=[4,2,1,2];h.default.registerEdge("dashed",{afterDraw:function(e,i){(null==i?void 0:i.get("children")[0]).attr("lineDash",t)},setState:function(t,e,i){i._cfg.group.destroyed||R(t,e,i)}},"quadratic")}(),Z(l.handleClickNode.bind(l),l.handleHover.bind(l)),t=l.handleNodeDbClick,h.default.registerBehavior("click-add-edge",{getEvents:function(){return{"node:dblclick":"onClick",mousemove:"onMousemove","edge:dblclick":"onEdgeClick"}},onClick:function(e){t(e,this)},onMousemove:function(t){var e=this,i={x:t.x,y:t.y};e.addingEdge&&e.edge&&e.graph.updateItem(e.edge,{target:i})},onEdgeClick:function(t){var e=this,i=t.item;e.addingEdge&&e.edge===i&&(e.graph.removeItem(e.edge),e.edge=null,e.addingEdge=!1)}}),function(t){h.default.registerBehavior("click-add-node",{getEvents:function(){return{"canvas:dblclick":"onClick"}},onClick:function(e){t(e,this)}})}(l.handleCanvasDblclick),[]},this.handleCanvasDblclick=function(t,e){clearTimeout(l.timer);var i=e.graph,n=i.getNodes();i.addItem("node",{x:t.canvasX,fx:t.canvasX,y:t.canvasY,fy:t.canvasY,label:"node-"+n.length,id:"node-"+n.length})},this.handleNodeDbClick=function(t,e){clearTimeout(l.timer);var i=t.item,n=e.graph,o=i.getModel();e.addingEdge&&e.edge?(n.updateItem(e.edge,{target:o.id}),e.edge=null,e.addingEdge=!1):(e.edge=n.addItem("edge",{source:o.id,target:o.id}),e.addingEdge=!0)},this.initAction=function(t){t.on("node:mouseenter",(function(e){var i=e.item,l=i.getEdges();t.setItemState(i,p.Hover,!0);var n=i.getModel().id;l.forEach((function(e){var i=e.getSource(),l=e.getTarget();i&&l&&(null==t||t.setItemState(e,v.Running,!0),i._cfg.id!==n&&(null==t||t.setItemState(i,p.HoverNeighbor,!0)),l._cfg.id!==n&&(null==t||t.setItemState(l,p.HoverNeighbor,!0)))}))})),t.on("node:mouseleave",(function(e){var i=e.item,l=i.getEdges();null==t||t.setItemState(i,p.Hover,!1);var n=i.getModel().id;l.forEach((function(e){var i,l=e.getSource(),o=e.getTarget();l&&o&&(null==t||t.setItemState(e,v.Running,!1),l._cfg&&l._cfg.id!==n&&(null==t||t.setItemState(l,p.HoverNeighbor,!1)),o._cfg&&(null===(i=o._cfg)||void 0===i?void 0:i.id)!==n&&(null==t||t.setItemState(o,p.HoverNeighbor,!1)))}))})),t.on("node:click",(function(e){var i,o;e.stopPropagation();var a=e.item;console.log("node==>",a),l.activeNode=a._cfg.id;var r=null===(i=a._cfg)||void 0===i?void 0:i.model,s=t.findAllByState("node","click");(null===(o=r.children)||void 0===o?void 0:o.length)?l.clickNodes=s:(s.forEach((function(e){t.setItemState(e,"click",!1)})),r.count||t.setItemState(a,"click",!0),l.clickNodes=[a]),l.timer&&clearTimeout(l.timer),l.timer=n.delay((function(){r&&(r.count&&r.children?l.handleClickNode("count",r):(l.nodeClickLevel(r),l.nodeClick.emit(r)))}),300)}))},this._throttleScroll=n.throttle(this.throttleScroll.bind(this),100)}return t.prototype.ngOnInit=function(){this.posHandle(this.remoteData,this.levelData),this.drawCanvasChart(),this.tuopuRef=document.getElementById("scroll-tuopu")},t.prototype.ngOnDestroy=function(){this.baseGraph&&this.baseGraph.destroy()},t.prototype.getIconSrc=function(t,e,i){if(i)return e?"assets/images/topology/ceng_active.svg":"assets/images/topology/ceng.svg";var l=this.levelIconFind(t);return l?e?"assets/images/topology/"+l+"_active@2x.svg":"assets/images/topology/"+l+"@2x.svg":e?"assets/images/topology/layer_default_active@2x.svg":"assets/images/topology/layer_default@2x.svg"},t.prototype.throttleScroll=function(t){var e,i;console.log(t),this.scrollLeftPx=(null===(e=null==t?void 0:t.target)||void 0===e?void 0:e.scrollLeft)||100,(null===(i=null==t?void 0:t.target)||void 0===i?void 0:i.scrollLeft)<5?this.scrollChart=!1:this.scrollChart=!0},t.prototype.levelIconFind=function(t){return["layer_bizsystem","layer_application","layer_service","layer_container","layer_host","layer_network","layer_infra"].find((function(e){return e===t}))},t.prototype.levelActive=function(t,e){t.forEach((function(t){return t.selected=!1})),e.selected=!0,this.levelClick.emit(e);var i=250;this.expandChart&&(i=this.maxChartWidth<460?250+this.maxChartWidth:this.maxWindowWidth),this.scrollLeftPx=100,this.sizeChange.emit({width:i})},t.prototype.nodeClickLevel=function(t){var e=this.levelData.find((function(e,i){return i+1===t.level}));this.levelData.forEach((function(t){return t.selected=!1})),e.selected=!0},t.prototype.packLevel=function(){this.expandChart=!1;var t=250;this.expandChart&&(t=this.maxChartWidth<460?250+this.maxChartWidth:850),this.expandChartChange.emit(),this.scrollLeftPx=100,this.sizeChange.emit({width:t})},t.prototype.posHandle=function(t,e){var i=this;console.log("posHandle==>",t,e),this.convertData={};for(var l={},n=80,o=168,a=e.length,r=0,s=0;s<a;s++)this.convertData[s+1]=[];for(var d in t.nodes.forEach((function(t){e.forEach((function(e,i){t.code===e.code&&(t.level=i+1)})),i.convertData.hasOwnProperty(t.level)?i.convertData[t.level].push(t.child?50:n):i.convertData[t.level]=[n]})),this.convertData){var c=this.convertData[d].length?this.convertData[d].reduce((function(t,e){return t+e})):0;r=c>r?c:r}var u=r/2+36,h=(r-n)/2+2.4+50,g=(r+n)/2-n+50;for(var d in this.convertData)l[d]={total:this.convertData[d].length,list:this.convertData[d],multiple:parseInt(String(this.convertData[d].length/2),10),remainder:this.convertData[d].length%2};var f={},p=0;for(var d in console.log("XData",l,h,g),l){p++,f[d]=[];var v=l[d].list;if(0!==l[d].total)if(1!==l[d].total)if(2!==l[d].total){if(0===l[d].remainder){f[d][l[d].multiple-1]={x:h,y:o*p},f[d][l[d].multiple]={x:g+v[l[d].multiple],y:o*p};for(var m=l[d].multiple-1;m>0;m--)f[d][m-1]={x:f[d][m].x-v[m],y:o*p};for(m=l[d].multiple;m<l[d].total+1;m++)f[d][m]={x:f[d][m-1].x+v[m-1],y:o*p}}else{f[d][l[d].multiple]={x:u,y:o*p};for(m=l[d].multiple-1;m>=0;m--)f[d][m]={x:f[d][m+1].x-v[m],y:o*p};for(m=l[d].multiple+1;m<l[d].total+1;m++)f[d][m]={x:f[d][m-1].x+v[m],y:o*p}}console.log("remainder",l[d].remainder)}else{var y=g;g-h<n/3&&(y=g+n),f[d]=[{x:h,y:o*p},{x:y,y:o*p}]}else f[d]=[{x:u,y:o*p}]}this.maxChartWidth=r<220?this.minChaertWidth:r+230,this.maxChartHeight=o*p,t.nodes.forEach((function(t,e){for(var i in f)if(t.level==i){var l=f[i].splice(0,1);t.x=parseInt(l[0].x),t.y=parseInt(l[0].y)-100,t.icon=t.icon||"默认icon"}})),this.checkLink(t),console.log("dataNode data==> 节点信息:",t,"convertData",this.convertData)},t.prototype.changelineId=function(t,e,i,l){var n,o,a=null===(n=this.cacheRemoteData.edges)||void 0===n?void 0:n.find((function(t){return t.target===i.id})),r=null===(o=this.cacheRemoteData.edges)||void 0===o?void 0:o.find((function(t){return t.source===i.id}));if(a){var s=this.allNodesList.find((function(t){return t.id===a.source}));if(null==s?void 0:s.group)(d=e.find((function(t){return t.group===s.group&&!t.child})))&&t.push({source:d.id,target:l.id,style:{lineDash:[3]}})}if(r){var d,c=this.allNodesList.find((function(t){return t.id===r.target}));if(null==c?void 0:c.group)(d=e.find((function(t){return t.group===c.group&&!t.child})))&&t.push({source:l.id,target:d.id,style:{lineDash:[3]}})}},t.prototype.checkLink=function(t){var e=this,i=t.nodes,l=t.edges;i.map((function(t){var n;(null===(n=t.children)||void 0===n?void 0:n.length)?t.children.map((function(n){e.changelineId(l,i,n,t)})):e.changelineId(l,i,t,t)}));for(var n=function(t){var e=i.find((function(e){return e.id===l[t].target})),n=i.find((function(e){return e.id===l[t].source}));e&&n||l.splice(t,1)},o=l.length;o-- >0;)n(o);i.forEach((function(t){var e=i.filter((function(e){return e.code===t.code}));1===(null==e?void 0:e.length)&&(t.isLine=!0)})),l.forEach((function(t){var e=i.find((function(e){return e.id===t.target})),l=i.find((function(e){return e.id===t.source}));e.isLine&&l.isLine?t.type="solid":t.type="solidCubic"})),t.edges=u.default.uniqWith(l,(function(t,e){return t.target===e.target&&t.source===e.source||t.target===e.source&&t.source===e.target})),console.log("edges1",l)},t.prototype.onCanvasClick=function(){console.log("onCanvasClick")},t.prototype.onEditSave=function(t){console.log(t)},t.prototype.updateChartData=function(t,e,i,l,o){var a,r,s,d,c,u=this,h=t;i||(this.cacheLevelData=n.cloneDeep(e),this.cacheRemoteData=n.cloneDeep(t),this.allNodesList=[],this.nodeChildren={},null===(a=this.cacheRemoteData)||void 0===a||a.nodes.map((function(t){var e;(null===(e=t.children)||void 0===e?void 0:e.length)?t.children.map((function(t){u.allNodesList.push(t)})):u.allNodesList.push(t)})),this.lastCacheData=n.cloneDeep(t)),console.log("传进组件的原始数据",n.cloneDeep(h)),this.posHandle(h,e);var g={nodes:n.clone(t.nodes.map((function(t){return Object.assign(Object.assign({},t),{status:"",style:t.style||n.cloneDeep(j.defaultNode.style),stateStyles:t.stateStyles||n.cloneDeep(j.nodeStateStyles),iconStyle:t.iconStyle||n.cloneDeep(j.defaultNode.iconStyle),iconImageStyle:t.iconImageStyle||n.cloneDeep(j.defaultNode.iconImageStyle),countStyle:t.countStyle||n.cloneDeep(j.defaultNode.countStyle)})}))),edges:n.cloneDeep(t.edges.map((function(t){return Object.assign({},t)})))};if(console.log("this.maxChartWidth",this.maxChartWidth),console.log("this.maxChartHeight",this.maxChartHeight),console.log("resultData",g),null===(r=document.querySelector(".topo-content"))||void 0===r||(r.scrollLeft=0),null===(s=this.baseGraph)||void 0===s||s.changeData(g),null===(d=this.baseGraph)||void 0===d||d.changeSize(this.maxChartWidth,this.maxChartHeight),o){for(var f=[],p=0,v=0;v<e.length;v++)if(this.convertData[v+1].length){f=this.convertData[v+1],p=v;break}var m=this.nodeWidth*f.length;f.map((function(t){m+=t})),null===(c=this.baseGraph)||void 0===c||c.moveTo(this.maxChartWidth/2-m/2,59+168*p)}var y=.95*(this.containerWidth-250);this.maxChartWidth>460&&(this.maxWindowWidth=850),this.maxChartWidth>y&&(this.maxWindowWidth=y,this.tuopuRef.scrollTo({left:y/4}));var x=this.maxChartWidth<460?250+this.maxChartWidth:this.maxWindowWidth;this.sizeChange.emit({width:x,targetId:l})},t.prototype.drawCanvasChart=function(){var t=new h.default.Tooltip({itemTypes:["node"],offsetX:10,offsetY:10,fixToNode:[1,.5],getContent:function(t){return"<div class=topology_tooltip>"+t.item.getModel().label+"</div>"},shouldBegin:function(t){return"label"===t.target.cfg.name&&t.target.cfg.overflow}});this.baseGraph=new o.Graph(Object.assign(Object.assign(Object.assign({},j),this.config||{}),{container:"topo",modes:{default:[{type:"drag-canvas",direction:"x"}]},width:this.maxChartWidth,height:this.maxChartHeight,plugins:f([t],this.initChart())})),this.baseGraph.data(this.remoteData),this.baseGraph.render(),this.initAction(this.baseGraph),this.baseGraph.get("canvas").set("localRefresh",!1)},t.prototype.handleHover=function(t){console.log("item",t.getBBox());var e=t.getBBox().x,i=.95*(this.containerWidth-250),l=100===this.scrollLeftPx?0:this.scrollLeftPx;this.maxWindowWidth-e-250+l<=180&&(this.maxWindowWidth+=200,this.maxWindowWidth>=i&&(this.maxWindowWidth=i,this.scrollLeftPx+=150,this.tuopuRef.scrollTo({left:this.scrollLeftPx,behavior:"smooth"})),this.sizeChange.emit({width:this.maxWindowWidth}))},t.prototype.drawHulls=function(){var t=this;Object.keys(this.nodeChildren).map((function(e){var i,l=t.cacheRemoteData.nodes.find((function(t){return t.group===e})),n=l.alertNum>0?l.alertNum+"/"+l.count:""+l.count;t.baseGraph.createHull({id:"leafNode-hull_"+e,members:t.nodeChildren[e],padding:6,style:{lineDash:[3],fill:"transparent",stroke:"#000"}});var o=t.baseGraph.getHullById("leafNode-hull_"+e),a=o.group.getBBox(),r=7*n.length+6+8+8,s=null===(i=o.group)||void 0===i?void 0:i.addShape("rect",{attrs:Object.assign(Object.assign({},a),{x:a.x+a.width/2-r/2,y:a.y+a.height-5,width:r,height:16,fill:"#001A4F",radius:3,cursor:"pointer",lineWidth:0}),name:"hull-rect",id:"hull-rect_"+e,draggable:!0,zIndex:30,visible:!0});console.log("hideTextCount",a,n);var d=o.group.addShape("text",{attrs:{text:n,x:a.x+a.width/2,y:a.y+a.height-3,fontSize:12,cursor:"pointer",textAlign:"center",textBaseline:"top",fill:"#fff"},name:"hull-text",id:"hull-text_"+e,draggable:!0,zIndex:40,visible:!0}),c=o.group.addShape("polygon",{attrs:{points:[[a.x+a.width/2-r/2+8,a.y+a.height+3],[a.x+a.width/2-r/2+4,a.y+a.height-1],[a.x+a.width/2-r/2+4,a.y+a.height+7]],fill:"#fff",cursor:"pointer"},name:"marker-shape",id:"marker-shape_"+e,draggable:!0,zIndex:50,visible:!0}),u=o.group.addShape("polygon",{attrs:{points:[[a.x+a.width/2+r/2-8,a.y+a.height+3],[a.x+a.width/2+r/2-4,a.y+a.height-1],[a.x+a.width/2+r/2-4,a.y+a.height+7]],fill:"#fff",cursor:"pointer"},name:"marker-shape",id:"marker-shape_"+e,draggable:!0,zIndex:50,visible:!0});null==u||u.on("click",(function(e){e.stopPropagation(),t.handleHideCount(l)})),null==c||c.on("click",(function(e){e.stopPropagation(),t.handleHideCount(l)})),null==s||s.on("click",(function(e){e.stopPropagation(),t.handleHideCount(l)})),null==d||d.on("click",(function(e){e.stopPropagation(),t.handleHideCount(l)}))}))},t.prototype.handleHideCount=function(t){var e,i;console.log(t);var l=u.default.cloneDeep(this.lastCacheData);l.nodes=null===(e=l.nodes)||void 0===e?void 0:e.filter((function(e){return e.group!==t.group}));var n=null===(i=this.cacheRemoteData.nodes)||void 0===i?void 0:i.find((function(e){return e.group&&e.group===t.group&&e.code===t.code})),o=this.lastCacheData.nodes.findIndex((function(t){return t.group===n.group&&t.code===n.code&&t.child}));l.nodes.splice(o,0,n),this.nodeChildren[t.group]&&delete this.nodeChildren[t.group],this.lastCacheData=l,this.updateChartData(l,this.cacheLevelData,!0),this.restoreClickNodes(),u.default.isEmpty(this.nodeChildren)||this.drawHulls()},t.prototype.restoreClickNodes=function(){var t=this;this.clickNodes.forEach((function(e){var i;e&&!e.destroyed&&e._cfg&&(null===(i=t.baseGraph)||void 0===i||i.setItemState(e,"click",!0))}))},t.prototype.handleClickNode=function(t,e){if("count"===t){if(console.log("点击了统计",e),!e.children||!e.children.length)return;var i=this.recovertCount(e);console.log("111111",i),this.updateChartData(i,this.cacheLevelData,!0),this.restoreClickNodes(),this.baseGraph.removeHulls(),u.default.isEmpty(this.nodeChildren)||this.drawHulls()}else"url"===t?this.nodeLinkClick.emit(e):this.nodeDrillClick.emit(e)},t.prototype.recovertCount=function(t){var e,i,l,o=t.id,a=t.code,r=n.cloneDeep(this.lastCacheData),s=this.lastCacheData.nodes.filter((function(t){return t.code===a})),d={};if(s.map((function(t){t.group&&d[t.group]&&(l=t),t.group&&(d[t.group]=t)})),l){var c=null===(e=this.cacheRemoteData.nodes)||void 0===e?void 0:e.find((function(t){var e;return t.group===l.group&&(null===(e=t.children)||void 0===e?void 0:e.length)})),h=this.lastCacheData.nodes.findIndex((function(t){return t.group==c.group}));r.nodes=this.lastCacheData.nodes.filter((function(t){return t.group!==l.group})),r.nodes.splice(h,0,c),delete this.nodeChildren[c.group]}var g=null===(i=r.nodes.find((function(t){return t.id===o})))||void 0===i?void 0:i.children;this.nodeChildren[t.group]=g.map((function(t){return t.id}));var f=r.nodes.findIndex((function(t){return t.id===o})),p=r.nodes.slice(0,f),v=r.nodes.slice(f+1);return r.nodes=p.concat(g).concat(v),console.log("点击的数据==>",r.nodes),console.log("处理前",n.cloneDeep(r)),r.edges=u.default.cloneDeep(this.cacheRemoteData.edges),this.checkLink(r),console.log("处理后",n.cloneDeep(r.edges)),this.lastCacheData=r,r},t.prototype.setNodeState=function(t,e,i){var l=this;void 0===i&&(i=!1);var n=this.baseGraph.findAll("node",(function(t){return!0})),o=[];n.forEach((function(e){t.includes(e.getModel().id)&&o.push(e)})),o.forEach((function(t){l.baseGraph.setItemState(t,e,i)}))},t.prototype.setNodesHightLight=function(t){var e=this,i=this.baseGraph.findAll("node",(function(t){return!0})),l=[];i.forEach((function(e){t.includes(e.getModel().id)&&l.push(e)})),l.forEach((function(t){e.baseGraph.setItemState(t,"click",!0)}))},t.prototype.clearNodesHightLight=function(){var t=this;this.baseGraph.findAll("node",(function(t){return!0})).forEach((function(e){t.baseGraph.setItemState(e,"click",!1)}))},t}();tt.decorators=[{type:e.Component,args:[{selector:"app-level-topo",template:' <div class="topo-wrap" >\r\n <div class="topo-layer" id="topo-cus-wrap" [ngStyle]="expandChart ? { width: maxChartWidth < 460 ? 250 + maxChartWidth + \'px\' : maxWindowWidth + \'px\' } : { width: \'250px\' }">\r\n\x3c!-- <span nz-icon class="pack-icon" [nzType]="expandChart ? \'menu-fold\' : \'menu-unfold\'" nzTheme="outline" (click)="packLevel()"></span>--\x3e\r\n <span *ngIf="expandChart && showExpand" nz-icon class="pack-icon" [nzType]="expandChart ? \'double-left\' : \'double-right\'" nzTheme="outline" (click)="packLevel()"></span>\r\n <div class="topo-left">\r\n <section *ngFor="let level of levelData; let i = index"\r\n [ngClass]="{ \'level-c\': level.selected}"\r\n (click)="levelActive(levelData, level)"\r\n >\r\n <div class="level-title">\r\n\x3c!-- <i class="iconfont mr8" [ngClass]="[levelIconFind(level.icon) ? \'icon\' + level.icon : \'iconlayer_default\']"></i>--\x3e\r\n <img style="width: 25px;" [src]="getIconSrc(level.icon, level.selected)">\r\n <span nz-tooltip [nzTooltipTitle]="level.name">{{ level.name | textMiddleEllipsis: 5 }}</span>\r\n </div>\r\n <div class="level-content">\r\n\x3c!-- <i class="iconfont iconceng_xuanzhong1"></i>--\x3e\r\n <img class="level-grade-img" [src]="getIconSrc(level.icon, level.selected, \'level\')">\r\n <div class="level-grade">\r\n <span class="red" *ngIf="level.alertCount > 0">{{level.alertCount}}</span>\r\n <span>{{level.instanceCount || 0}}</span>\r\n </div>\r\n </div>\r\n </section>\r\n <div class="left-box-shadow" [ngStyle]="scrollChart ? {display: \'block\'} : {display:\'none\'}"></div>\r\n </div>\r\n <div class="topo-content scroll-x"\r\n id="scroll-tuopu"\r\n (scroll)="_throttleScroll($event)"\r\n >\r\n <div id="topo"></div>\r\n </div>\r\n\r\n </div>\r\n </div>\r\n',styles:['#topo-cus-wrap,.topo-layer{position:relative}.topo-layer{width:100%}.topo-layer .red{color:red}.topo-layer .topo-left{position:relative}.topo-layer .topo-left section{background:#f9f9f9;height:168px;align-items:center;display:flex;flex-wrap:wrap;padding-left:34px;border-left:4px solid transparent;cursor:pointer}.topo-layer .topo-left section:nth-child(2n){background:#fff}.topo-layer .topo-left .left-box-shadow{display:none;position:absolute;top:0;bottom:0;left:0;box-shadow:6px 0 8px 0 rgba(0,0,0,.05);width:250px;pointer-events:none}.topo-layer .topo-left .level-title{flex:100%;align-self:flex-end;margin-top:8px}.topo-layer .topo-left .level-title span{font-size:16px;padding-left:14px}.topo-layer .topo-left .level-title .iconfont{font-size:14px;color:#3e425b}.topo-layer .topo-left .level-content{align-self:flex-start}.topo-layer .topo-left .level-content .iconceng_xuanzhong1{color:rgba(181,191,218,.5)}.topo-layer .pack-icon{position:absolute;top:17px;right:24px;cursor:pointer;z-index:9}.topo-layer .topo-content{position:absolute;width:calc(100% - 250px);top:0;right:0;bottom:0}.topo-layer .level-grade-img{scale:1;position:relative;left:-6px}.topo-layer .level-grade{position:relative;top:-16px;left:74px;width:100px;text-align:right}.topo-layer .level-grade .red:after{content:"/";margin:0 5px;color:#000}.topo-layer .level-c{border-left:4px solid #4686e9!important}.topo-layer .level-c .iconfont,.topo-layer .level-c .level-title{color:#4686e9!important}.topo-layer .level-c .iconceng{color:#4686e9}.scroll-x{overflow-x:auto;overflow-y:hidden}.scroll-x::-webkit-scrollbar-track{background:transparent}.scroll-x::-webkit-scrollbar{width:8px;height:8px;background:transparent;border-radius:5px}.scroll-x::-webkit-scrollbar-thumb{background-color:hsla(0,0%,100%,0);border-radius:2px!important}.scroll-x::-webkit-scrollbar-thumb:hover{background-color:rgba(0,0,0,.6)}']}]}],tt.ctorParameters=function(){return[{type:l.ActivatedRoute},{type:l.Router}]},tt.propDecorators={levelData:[{type:e.Input}],showExpand:[{type:e.Input}],containerWidth:[{type:e.Input}],nodeClick:[{type:e.Output}],nodeDrillClick:[{type:e.Output}],nodeLinkClick:[{type:e.Output}],levelClick:[{type:e.Output}],expandChartChange:[{type:e.Output}],sizeChange:[{type:e.Output}]};var et=function(){function t(){}return t.prototype.transform=function(t,e){if(e||(e=10),t&&t.length>2*e){return t.substring(0,e)+"..."+t.slice(-Math.floor(e/2))}return t},t}();et.decorators=[{type:e.Pipe,args:[{name:"textMiddleEllipsis"}]}];var it=function(){};it.decorators=[{type:e.NgModule,args:[{declarations:[et],exports:[et,r.TranslateModule]}]}];var lt=function(){};lt.decorators=[{type:e.NgModule,args:[{declarations:[tt],imports:[i.CommonModule,s.NzToolTipModule,d.NzIconModule,it],exports:[tt]}]}],t.MetricTopoChartComponent=tt,t.MetricTopoChartModule=lt,t["ɵa"]=it,t["ɵb"]=et,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=webcmp-topo-chart-vertical.umd.min.js.map
{
"name": "webcmp-topo-chart-vertical",
"version": "0.0.2",
"version": "0.0.3",
"peerDependencies": {

@@ -5,0 +5,0 @@ "@angular/common": "^11.1.2",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc