UNPKG

basb-cli

Version:
2 lines (1 loc) 19.3 kB
import{b as e,J as t,h as a,d as o,a2 as r,aw as n,e as i,ax as s,ay as l,az as u,aA as c,aB as g,aC as d,aD as p,aE as f,aq as y,aF as h,ap as m,aG as v,aH as S,aI as L,_,u as b,g as x,C as I,ao as w,aJ as M,aK as D,aL as N,m as A,aM as V,S as T,aN as C}from"./index.js";import{V as j,u as z,a as P,b as E}from"./roamHelper.js";import{S as B}from"./SymbolDraw.js";import{L as R}from"./LineDraw.js";import{R as k}from"./RoamController.js";import{o as G}from"./cursorHelper.js";import{c as F}from"./createGraphFromNodeEdge.js";import{L as H}from"./LegendVisualProvider.js";import"./Symbol.js";import"./labelHelper.js";import"./interactionMutex.js";import"./linkSeriesData.js";function U(t){var a=t.findComponents({mainType:"legend"});a&&a.length&&t.eachSeriesByType("graph",(function(t){var o=t.getCategoriesData(),r=t.getGraph().data,n=o.mapArray(o.getName);r.filterSelf((function(t){var o=r.getItemModel(t).getShallow("category");if(null!=o){e(o)&&(o=n[o]);for(var i=0;i<a.length;i++)if(!a[i].isSelected(o))return!1}return!0}))}))}function Y(e){var o={};e.eachSeriesByType("graph",(function(e){var r=e.getCategoriesData(),n=e.getData(),i={};r.each((function(t){var a=r.getName(t);i["ec-"+a]=t;var n=r.getItemModel(t),s=n.getModel("itemStyle").getItemStyle();s.fill||(s.fill=e.getColorFromPalette(a,o)),r.setItemVisual(t,"style",s);for(var l=["symbol","symbolSize","symbolKeepAspect"],u=0;u<l.length;u++){var c=n.getShallow(l[u],!0);null!=c&&r.setItemVisual(t,l[u],c)}})),r.count()&&n.each((function(e){var o=n.getItemModel(e).getShallow("category");if(null!=o){t(o)&&(o=i["ec-"+o]);var s=r.getItemVisual(o,"style"),l=n.ensureUniqueItemVisual(e,"style");a(l,s);for(var u=["symbol","symbolSize","symbolKeepAspect"],c=0;c<u.length;c++)n.setItemVisual(e,u[c],r.getItemVisual(o,u[c]))}}))}))}function X(e){return e instanceof Array||(e=[e,e]),e}function Z(e){e.eachSeriesByType("graph",(function(e){var t=e.getGraph(),o=e.getEdgeData(),r=X(e.get("edgeSymbol")),n=X(e.get("edgeSymbolSize"));o.setVisual("fromSymbol",r&&r[0]),o.setVisual("toSymbol",r&&r[1]),o.setVisual("fromSymbolSize",n&&n[0]),o.setVisual("toSymbolSize",n&&n[1]),o.setVisual("style",e.getModel("lineStyle").getLineStyle()),o.each((function(e){var r=o.getItemModel(e),n=t.getEdgeByIndex(e),i=X(r.getShallow("symbol",!0)),s=X(r.getShallow("symbolSize",!0)),l=r.getModel("lineStyle").getLineStyle(),u=o.ensureUniqueItemVisual(e,"style");switch(a(u,l),u.stroke){case"source":var c=n.node1.getVisual("style");u.stroke=c&&c.fill;break;case"target":c=n.node2.getVisual("style");u.stroke=c&&c.fill}i[0]&&n.setVisual("fromSymbol",i[0]),i[1]&&n.setVisual("toSymbol",i[1]),s[0]&&n.setVisual("fromSymbolSize",s[0]),s[1]&&n.setVisual("toSymbolSize",s[1])}))}))}var O="--\x3e",q=function(e){return e.get("autoCurveness")||null},K=function(t,a){var r=q(t),n=20,i=[];if(e(r))n=r;else if(o(r))return void(t.__curvenessList=r);a>n&&(n=a);var s=n%2?n+2:n+3;i=[];for(var l=0;l<s;l++)i.push((l%2?l+1:l)/10*(l%2?-1:1));t.__curvenessList=i},J=function(e,t,a){var o=[e.id,e.dataIndex].join("."),r=[t.id,t.dataIndex].join(".");return[a.uid,o,r].join(O)},W=function(e){var t=e.split(O);return[t[0],t[2],t[1]].join(O)},Q=function(e,t){var a=J(e.node1,e.node2,t);return t.__edgeMap[a]},$=function(e,t){return ee(J(e.node1,e.node2,t),t)+ee(J(e.node2,e.node1,t),t)},ee=function(e,t){var a=t.__edgeMap;return a[e]?a[e].length:0};function te(e,t,a,r){var n=q(t),i=o(n);if(!n)return null;var s=Q(e,t);if(!s)return null;for(var l=-1,u=0;u<s.length;u++)if(s[u]===a){l=u;break}var c=$(e,t);K(t,c),e.lineStyle=e.lineStyle||{};var g=J(e.node1,e.node2,t),d=t.__curvenessList,p=i||c%2?0:1;if(s.isForward)return d[p+l];var f=W(g),y=ee(f,t),h=d[l+y+p];return r?i?n&&0===n[0]?(y+p)%2?h:-h:((y%2?0:1)+p)%2?h:-h:(y+p)%2?h:-h:d[l+y+p]}function ae(e){var t=e.coordinateSystem;if(!t||"view"===t.type){var a=e.getGraph();a.eachNode((function(e){var t=e.getModel();e.setLayout([+t.get("x"),+t.get("y")])})),oe(a,e)}}function oe(e,t){e.eachEdge((function(e,a){var o=r(e.getModel().get(["lineStyle","curveness"]),-te(e,t,a,!0),0),i=n(e.node1.getLayout()),s=n(e.node2.getLayout()),l=[i,s];+o&&l.push([(i[0]+s[0])/2-(i[1]-s[1])*o,(i[1]+s[1])/2-(s[0]-i[0])*o]),e.setLayout(l)}))}function re(e,t){e.eachSeriesByType("graph",(function(e){var t=e.get("layout"),a=e.coordinateSystem;if(a&&"view"!==a.type){var o=e.getData(),r=[];i(a.dimensions,(function(e){r=r.concat(o.mapDimensionsAll(e))}));for(var n=0;n<o.count();n++){for(var s=[],l=!1,u=0;u<r.length;u++){var c=o.get(r[u],n);isNaN(c)||(l=!0),s.push(c)}l?o.setItemLayout(n,a.dataToPoint(s)):o.setItemLayout(n,[NaN,NaN])}oe(o.graph,e)}else t&&"none"!==t||ae(e)}))}function ne(e){var t=e.coordinateSystem;if("view"!==t.type)return 1;var a=e.option.nodeScaleRatio,o=t.scaleX;return((t.getZoom()-1)*a+1)/o}function ie(e){var t=e.getVisual("symbolSize");return t instanceof Array&&(t=(t[0]+t[1])/2),+t}var se=Math.PI,le=[];function ue(e,t,a,o){var i=e.coordinateSystem;if(!i||"view"===i.type){var u=i.getBoundingRect(),c=e.getData(),g=c.graph,d=u.width/2+u.x,p=u.height/2+u.y,f=Math.min(u.width,u.height)/2,y=c.count();if(c.setLayout({cx:d,cy:p}),y){if(a){var h=i.pointToData(o),m=h[0],v=h[1],S=[m-d,v-p];s(S,S),l(S,S,f),a.setLayout([d+S[0],p+S[1]],!0),ge(a,e.get(["circular","rotateLabel"]),d,p)}ce[t](e,g,c,f,d,p,y),g.eachEdge((function(t,a){var o,i=r(t.getModel().get(["lineStyle","curveness"]),te(t,e,a),0),s=n(t.node1.getLayout()),l=n(t.node2.getLayout()),u=(s[0]+l[0])/2,c=(s[1]+l[1])/2;+i&&(o=[d*(i*=3)+u*(1-i),p*i+c*(1-i)]),t.setLayout([s,l,o])}))}}}var ce={value:function(e,t,a,o,r,n,i){var s=0,l=a.getSum("value"),u=2*Math.PI/(l||i);t.eachNode((function(e){var t=e.getValue("value"),a=u*(l?t:1)/2;s+=a,e.setLayout([o*Math.cos(s)+r,o*Math.sin(s)+n]),s+=a}))},symbolSize:function(e,t,a,o,r,n,i){var s=0;le.length=i;var l=ne(e);t.eachNode((function(e){var t=ie(e);isNaN(t)&&(t=2),t<0&&(t=0),t*=l;var a=Math.asin(t/2/o);isNaN(a)&&(a=se/2),le[e.dataIndex]=a,s+=2*a}));var u=(2*se-s)/i/2,c=0;t.eachNode((function(e){var t=u+le[e.dataIndex];c+=t,(!e.getLayout()||!e.getLayout().fixed)&&e.setLayout([o*Math.cos(c)+r,o*Math.sin(c)+n]),c+=t}))}};function ge(e,t,o,r){var n=e.getGraphicEl();if(n){var i=e.getModel().get(["label","rotate"])||0,s=n.getSymbolPath();if(t){var l=e.getLayout(),u=Math.atan2(l[1]-r,l[0]-o);u<0&&(u=2*Math.PI+u);var c=l[0]<o;c&&(u-=Math.PI);var g=c?"left":"right";s.setTextConfig({rotation:-u,position:g,origin:"center"});var d=s.ensureState("emphasis");a(d.textConfig||(d.textConfig={}),{position:g})}else s.setTextConfig({rotation:i*=Math.PI/180})}}function de(e){e.eachSeriesByType("graph",(function(e){"circular"===e.get("layout")&&ue(e,"symbolSize")}))}var pe=f;function fe(e){e.eachSeriesByType("graph",(function(e){var t=e.coordinateSystem;if(!t||"view"===t.type)if("force"===e.get("layout")){var a=e.preservedPoints||{},i=e.getGraph(),l=i.data,f=i.edgeData,h=e.getModel("force"),m=h.get("initLayout");e.preservedPoints?l.each((function(e){var t=l.getId(e);l.setItemLayout(e,a[t]||[NaN,NaN])})):m&&"none"!==m?"circular"===m&&ue(e,"value"):ae(e);var v=l.getDataExtent("value"),S=f.getDataExtent("value"),L=h.get("repulsion"),_=h.get("edgeLength"),b=o(L)?L:[L,L],x=o(_)?_:[_,_];x=[x[1],x[0]];var I=l.mapArray("value",(function(e,t){var a=l.getItemLayout(t),o=y(e,v,b);return isNaN(o)&&(o=(b[0]+b[1])/2),{w:o,rep:o,fixed:l.getItemModel(t).get("fixed"),p:!a||isNaN(a[0])||isNaN(a[1])?null:a}})),w=f.mapArray("value",(function(t,a){var o=i.getEdgeByIndex(a),n=y(t,S,x);isNaN(n)&&(n=(x[0]+x[1])/2);var s=o.getModel(),l=r(o.getModel().get(["lineStyle","curveness"]),-te(o,e,a,!0),0);return{n1:I[o.node1.dataIndex],n2:I[o.node2.dataIndex],d:n,curveness:l,ignoreForceLayout:s.get("ignoreForceLayout")}})),M=t.getBoundingRect(),D=function(e,t,a){for(var o=e,r=t,i=a.rect,l=i.width,f=i.height,y=[i.x+l/2,i.y+f/2],h=null==a.gravity?.1:a.gravity,m=0;m<o.length;m++){var v=o[m];v.p||(v.p=u(l*(Math.random()-.5)+y[0],f*(Math.random()-.5)+y[1])),v.pp=n(v.p),v.edges=null}var S,L,_=null==a.friction?.6:a.friction,b=_;return{warmUp:function(){b=.8*_},setFixed:function(e){o[e].fixed=!0},setUnfixed:function(e){o[e].fixed=!1},beforeStep:function(e){S=e},afterStep:function(e){L=e},step:function(e){S&&S(o,r);for(var t=[],a=o.length,n=0;n<r.length;n++){var i=r[n];if(!i.ignoreForceLayout){var l=i.n1,u=i.n2;c(t,u.p,l.p);var f=g(t)-i.d,m=u.w/(l.w+u.w);isNaN(m)&&(m=0),s(t,t),!l.fixed&&pe(l.p,l.p,t,m*f*b),!u.fixed&&pe(u.p,u.p,t,-(1-m)*f*b)}}for(n=0;n<a;n++)(I=o[n]).fixed||(c(t,y,I.p),pe(I.p,I.p,t,h*b));for(n=0;n<a;n++){l=o[n];for(var v=n+1;v<a;v++){u=o[v],c(t,u.p,l.p),0===(f=g(t))&&(d(t,Math.random()-.5,Math.random()-.5),f=1);var _=(l.rep+u.rep)/f/f;!l.fixed&&pe(l.pp,l.pp,t,_),!u.fixed&&pe(u.pp,u.pp,t,-_)}}var x=[];for(n=0;n<a;n++){var I;(I=o[n]).fixed||(c(x,I.p,I.pp),pe(I.p,I.p,x,b),p(I.pp,I.p))}var w=(b*=.992)<.01;L&&L(o,r,w),e&&e(w)}}}(I,w,{rect:M,gravity:h.get("gravity"),friction:h.get("friction")});D.beforeStep((function(e,t){for(var a=0,o=e.length;a<o;a++)e[a].fixed&&p(e[a].p,i.getNodeByIndex(a).getLayout())})),D.afterStep((function(e,t,o){for(var r=0,n=e.length;r<n;r++)e[r].fixed||i.getNodeByIndex(r).setLayout(e[r].p),a[l.getId(r)]=e[r].p;for(r=0,n=t.length;r<n;r++){var s=t[r],u=i.getEdgeByIndex(r),c=s.n1.p,g=s.n2.p,d=u.getLayout();(d=d?d.slice():[])[0]=d[0]||[],d[1]=d[1]||[],p(d[0],c),p(d[1],g),+s.curveness&&(d[2]=[(c[0]+g[0])/2-(c[1]-g[1])*s.curveness,(c[1]+g[1])/2-(g[0]-c[0])*s.curveness]),u.setLayout(d)}})),e.forceLayout=D,e.preservedPoints=a,D.step()}else e.forceLayout=null}))}function ye(e,t){var o=[];return e.eachSeriesByType("graph",(function(e){var r=e.get("coordinateSystem");if(!r||"view"===r){var n=e.getData(),i=n.mapArray((function(e){var t=n.getItemModel(e);return[+t.get("x"),+t.get("y")]})),s=[],l=[];h(i,s,l),l[0]-s[0]==0&&(l[0]+=1,s[0]-=1),l[1]-s[1]==0&&(l[1]+=1,s[1]-=1);var u=(l[0]-s[0])/(l[1]-s[1]),c=function(e,t,o){var r=a(e.getBoxLayoutParams(),{aspect:o});return m(r,{width:t.getWidth(),height:t.getHeight()})}(e,t,u);isNaN(u)&&(s=[c.x,c.y],l=[c.x+c.width,c.y+c.height]);var g=l[0]-s[0],d=l[1]-s[1],p=c.width,f=c.height,y=e.coordinateSystem=new j;y.zoomLimit=e.get("scaleLimit"),y.setBoundingRect(s[0],s[1],g,d),y.setViewRect(c.x,c.y,p,f),y.setCenter(e.get("center"),t),y.setZoom(e.get("zoom")),o.push(y)}})),o}var he=[],me=[],ve=[],Se=S,Le=L,_e=Math.abs;function be(e,t,a){for(var o,r=e[0],n=e[1],i=e[2],s=1/0,l=a*a,u=.1,c=.1;c<=.9;c+=.1){he[0]=Se(r[0],n[0],i[0],c),he[1]=Se(r[1],n[1],i[1],c),(p=_e(Le(he,t)-l))<s&&(s=p,o=c)}for(var g=0;g<32;g++){var d=o+u;me[0]=Se(r[0],n[0],i[0],o),me[1]=Se(r[1],n[1],i[1],o),ve[0]=Se(r[0],n[0],i[0],d),ve[1]=Se(r[1],n[1],i[1],d);var p=Le(me,t)-l;if(_e(p)<.01)break;var f=Le(ve,t)-l;u/=2,p<0?f>=0?o+=u:o-=u:f>=0?o-=u:o+=u}return o}function xe(e,t){var a=[],o=v,r=[[],[],[]],i=[[],[]],l=[];t/=2,e.eachEdge((function(e,u){var g=e.getLayout(),d=e.getVisual("fromSymbol"),y=e.getVisual("toSymbol");g.__original||(g.__original=[n(g[0]),n(g[1])],g[2]&&g.__original.push(n(g[2])));var h=g.__original;if(null!=g[2]){if(p(r[0],h[0]),p(r[1],h[2]),p(r[2],h[1]),d&&"none"!==d){var m=ie(e.node1),v=be(r,h[0],m*t);o(r[0][0],r[1][0],r[2][0],v,a),r[0][0]=a[3],r[1][0]=a[4],o(r[0][1],r[1][1],r[2][1],v,a),r[0][1]=a[3],r[1][1]=a[4]}if(y&&"none"!==y){m=ie(e.node2),v=be(r,h[1],m*t);o(r[0][0],r[1][0],r[2][0],v,a),r[1][0]=a[1],r[2][0]=a[2],o(r[0][1],r[1][1],r[2][1],v,a),r[1][1]=a[1],r[2][1]=a[2]}p(g[0],r[0]),p(g[1],r[2]),p(g[2],r[1])}else{if(p(i[0],h[0]),p(i[1],h[1]),c(l,i[1],i[0]),s(l,l),d&&"none"!==d){m=ie(e.node1);f(i[0],i[0],l,m*t)}if(y&&"none"!==y){m=ie(e.node2);f(i[1],i[1],l,-m*t)}p(g[0],i[0]),p(g[1],i[1])}}))}function Ie(e){return"view"===e.type}var we=function(e){function t(){var a=null!==e&&e.apply(this,arguments)||this;return a.type=t.type,a}return _(t,e),t.prototype.init=function(e,t){var a=new B,o=new R,r=this.group;this._controller=new k(t.getZr()),this._controllerHost={target:r},r.add(a.group),r.add(o.group),this._symbolDraw=a,this._lineDraw=o,this._firstRender=!0},t.prototype.render=function(e,t,a){var o=this,r=e.coordinateSystem;this._model=e;var n=this._symbolDraw,i=this._lineDraw,s=this.group;if(Ie(r)){var l={x:r.x,y:r.y,scaleX:r.scaleX,scaleY:r.scaleY};this._firstRender?s.attr(l):b(s,l,e)}xe(e.getGraph(),ne(e));var u=e.getData();n.updateData(u);var c=e.getEdgeData();i.updateData(c),this._updateNodeAndLinkScale(),this._updateController(e,t,a),clearTimeout(this._layoutTimeout);var g=e.forceLayout,d=e.get(["force","layoutAnimation"]);g&&this._startForceLayoutIteration(g,d);var p=e.get("layout");u.graph.eachNode((function(t){var a=t.dataIndex,r=t.getGraphicEl(),n=t.getModel();if(r){r.off("drag").off("dragend");var i=n.get("draggable");i&&r.on("drag",(function(n){switch(p){case"force":g.warmUp(),!o._layouting&&o._startForceLayoutIteration(g,d),g.setFixed(a),u.setItemLayout(a,[r.x,r.y]);break;case"circular":u.setItemLayout(a,[r.x,r.y]),t.setLayout({fixed:!0},!0),ue(e,"symbolSize",t,[n.offsetX,n.offsetY]),o.updateLayout(e);break;default:u.setItemLayout(a,[r.x,r.y]),oe(e.getGraph(),e),o.updateLayout(e)}})).on("dragend",(function(){g&&g.setUnfixed(a)})),r.setDraggable(i,!!n.get("cursor")),"adjacency"===n.get(["emphasis","focus"])&&(x(r).focus=t.getAdjacentDataIndices())}})),u.graph.eachEdge((function(e){var t=e.getGraphicEl(),a=e.getModel().get(["emphasis","focus"]);t&&"adjacency"===a&&(x(t).focus={edge:[e.dataIndex],node:[e.node1.dataIndex,e.node2.dataIndex]})}));var f="circular"===e.get("layout")&&e.get(["circular","rotateLabel"]),y=u.getLayout("cx"),h=u.getLayout("cy");u.graph.eachNode((function(e){ge(e,f,y,h)})),this._firstRender=!1},t.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose(),this._controllerHost=null},t.prototype._startForceLayoutIteration=function(e,t){var a=this;!function o(){e.step((function(e){a.updateLayout(a._model),(a._layouting=!e)&&(t?a._layoutTimeout=setTimeout(o,16):o())}))}()},t.prototype._updateController=function(e,t,a){var o=this,r=this._controller,n=this._controllerHost,i=this.group;r.setPointerChecker((function(t,o,r){var n=i.getBoundingRect();return n.applyTransform(i.transform),n.contain(o,r)&&!G(t,a,e)})),Ie(e.coordinateSystem)?(r.enable(e.get("roam")),n.zoomLimit=e.get("scaleLimit"),n.zoom=e.coordinateSystem.getZoom(),r.off("pan").off("zoom").on("pan",(function(t){z(n,t.dx,t.dy),a.dispatchAction({seriesId:e.id,type:"graphRoam",dx:t.dx,dy:t.dy})})).on("zoom",(function(t){P(n,t.scale,t.originX,t.originY),a.dispatchAction({seriesId:e.id,type:"graphRoam",zoom:t.scale,originX:t.originX,originY:t.originY}),o._updateNodeAndLinkScale(),xe(e.getGraph(),ne(e)),o._lineDraw.updateLayout(),a.updateLabelLayout()}))):r.disable()},t.prototype._updateNodeAndLinkScale=function(){var e=this._model,t=e.getData(),a=ne(e);t.eachItemGraphicEl((function(e,t){e&&e.setSymbolScale(a)}))},t.prototype.updateLayout=function(e){xe(e.getGraph(),ne(e)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},t.prototype.remove=function(){clearTimeout(this._layoutTimeout),this._layouting=!1,this._layoutTimeout=null,this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()},t.type="graph",t}(I),Me=we,De=function(e){function t(){var a=null!==e&&e.apply(this,arguments)||this;return a.type=t.type,a.hasSymbolVisual=!0,a}return _(t,e),t.prototype.init=function(t){e.prototype.init.apply(this,arguments);var a=this;function o(){return a._categoriesData}this.legendVisualProvider=new H(o,o),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},t.prototype.mergeOption=function(t){e.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},t.prototype.mergeDefaultAndTheme=function(t){e.prototype.mergeDefaultAndTheme.apply(this,arguments),w(t,"edgeLabel",["show"])},t.prototype.getInitialData=function(e,t){var a,o=e.edges||e.links||[],r=e.data||e.nodes||[],n=this;if(r&&o){q(a=this)&&(a.__curvenessList=[],a.__edgeMap={},K(a));var s=F(r,o,this,!0,(function(e,t){e.wrapMethod("getItemModel",(function(e){var t=n._categoriesModels[e.getShallow("category")];return t&&(t.parentModel=e.parentModel,e.parentModel=t),e}));var a=M.prototype.getModel;function o(e,t){var o=a.call(this,e,t);return o.resolveParentPath=r,o}function r(e){if(e&&("label"===e[0]||"label"===e[1])){var t=e.slice();return"label"===e[0]?t[0]="edgeLabel":"label"===e[1]&&(t[1]="edgeLabel"),t}return e}t.wrapMethod("getItemModel",(function(e){return e.resolveParentPath=r,e.getModel=o,e}))}));return i(s.edges,(function(e){!function(e,t,a,o){if(q(a)){var r=J(e,t,a),n=a.__edgeMap,i=n[W(r)];n[r]&&!i?n[r].isForward=!0:i&&n[r]&&(i.isForward=!0,n[r].isForward=!1),n[r]=n[r]||[],n[r].push(o)}}(e.node1,e.node2,this,e.dataIndex)}),this),s.data}},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.getCategoriesData=function(){return this._categoriesData},t.prototype.formatTooltip=function(e,t,a){if("edge"===a){var o=this.getData(),r=this.getDataParams(e,a),n=o.graph.getEdgeByIndex(e),i=o.getName(n.node1.dataIndex),s=o.getName(n.node2.dataIndex),l=[];return null!=i&&l.push(i),null!=s&&l.push(s),D("nameValue",{name:l.join(" > "),value:r.value,noValue:null==r.value})}return N({series:this,dataIndex:e,multipleSeries:t})},t.prototype._updateCategoriesData=function(){var e=A(this.option.categories||[],(function(e){return null!=e.value?e:a({value:0},e)})),t=new V(["value"],this);t.initData(e),this._categoriesData=t,this._categoriesModels=t.mapArray((function(e){return t.getItemModel(e)}))},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.setCenter=function(e){this.option.center=e},t.prototype.isAnimationEnabled=function(){return e.prototype.isAnimationEnabled.call(this)&&!("force"===this.get("layout")&&this.get(["force","layoutAnimation"]))},t.type="series.graph",t.dependencies=["grid","polar","geo","singleAxis","calendar"],t.defaultOption={z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},t}(T),Ne={type:"graphRoam",event:"graphRoam",update:"none"};function Ae(e){e.registerChartView(Me),e.registerSeriesModel(De),e.registerProcessor(U),e.registerVisual(Y),e.registerVisual(Z),e.registerLayout(re),e.registerLayout(e.PRIORITY.VISUAL.POST_CHART_LAYOUT,de),e.registerLayout(fe),e.registerCoordinateSystem("graphView",{dimensions:j.dimensions,create:ye}),e.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},C),e.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},C),e.registerAction(Ne,(function(e,t,a){t.eachComponent({mainType:"series",query:e},(function(t){var o=t.coordinateSystem,r=E(o,e,void 0,a);t.setCenter&&t.setCenter(r.center),t.setZoom&&t.setZoom(r.zoom)}))}))}export{Ae as install};