Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pinpoint-fe/server-map

Package Overview
Dependencies
Maintainers
2
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pinpoint-fe/server-map - npm Package Compare versions

Comparing version 0.0.10-rc.2 to 0.0.10-rc.3

12

dist/index.js

@@ -1,6 +0,6 @@

var ye=Object.defineProperty,Ee=Object.defineProperties;var Ne=Object.getOwnPropertyDescriptors;var oe=Object.getOwnPropertySymbols;var Me=Object.prototype.hasOwnProperty,ke=Object.prototype.propertyIsEnumerable;var se=(i,r,s)=>r in i?ye(i,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[r]=s,S=(i,r)=>{for(var s in r||(r={}))Me.call(r,s)&&se(i,s,r[s]);if(oe)for(var s of oe(r))ke.call(r,s)&&se(i,s,r[s]);return i},W=(i,r)=>Ee(i,Ne(r));import C from"react";import le from"cytoscape";import we from"cytoscape-dagre";import K from"lodash";var G={transactionStatus:{default:{stroke:"transparent",strokeWidth:10},good:{stroke:"#32BA94",strokeWidth:10},slow:{stroke:"#E48022",strokeWidth:10},bad:{stroke:"#F0515B",strokeWidth:10}},node:{default:{"background-color":"#FFF","border-width":"3","border-color":"#ddd","text-valign":"bottom","text-halign":"center","text-margin-y":4,"overlay-opacity":0,"font-family":"Helvetica, Arial, avn85, NanumGothic, ng, dotum, AppleGothic, sans-serif","font-size":12,"font-weight":"normal","text-wrap":"wrap","text-max-width":"200","line-height":1.5,color:"#000"},highlight:{"font-weight":"bold","font-size":14,"border-color":"#4A61D1"},main:{"font-weight":"bold","font-size":14}},edge:{default:{width:1.5,"font-size":"12px","font-weight":"normal","line-color":"#C0C3C8","target-arrow-color":"#C0C3C8","target-arrow-shape":"triangle","curve-style":"bezier","text-background-color":"white","text-background-opacity":.7,"text-background-padding":"5px","text-background-shape":"roundrectangle","overlay-opacity":0},highlight:{"font-size":"14px","font-weight":"bold","line-color":"#4763d0","target-arrow-color":"#4763d0"},loop:{"control-point-step-size":70,"loop-direction":"0deg","loop-sweep":"-90deg"}}};var re=.05,ie=47,U=2*Math.PI*ie,de=i=>{let{transactionInfo:r}=i;return"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(`
var ye=Object.defineProperty,Ee=Object.defineProperties;var Ne=Object.getOwnPropertyDescriptors;var oe=Object.getOwnPropertySymbols;var Me=Object.prototype.hasOwnProperty,ke=Object.prototype.propertyIsEnumerable;var se=(i,r,s)=>r in i?ye(i,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[r]=s,w=(i,r)=>{for(var s in r||(r={}))Me.call(r,s)&&se(i,s,r[s]);if(oe)for(var s of oe(r))ke.call(r,s)&&se(i,s,r[s]);return i},P=(i,r)=>Ee(i,Ne(r));import _ from"react";import le from"cytoscape";import we from"cytoscape-dagre";import K from"lodash";var z={transactionStatus:{default:{stroke:"transparent",strokeWidth:10},good:{stroke:"#32BA94",strokeWidth:10},slow:{stroke:"#E48022",strokeWidth:10},bad:{stroke:"#F0515B",strokeWidth:10}},node:{default:{"background-color":"#FFF","border-width":"3","border-color":"#ddd","text-valign":"bottom","text-halign":"center","text-margin-y":4,"overlay-opacity":0,"font-family":"Helvetica, Arial, avn85, NanumGothic, ng, dotum, AppleGothic, sans-serif","font-size":12,"font-weight":"normal","text-wrap":"wrap","text-max-width":"200","line-height":1.5,color:"#000"},highlight:{"font-weight":"bold","font-size":14,"border-color":"#4A61D1"},main:{"font-weight":"bold","font-size":14}},edge:{default:{width:1.5,"font-size":"12px","font-weight":"normal","line-color":"#C0C3C8","target-arrow-color":"#C0C3C8","target-arrow-shape":"triangle","curve-style":"bezier","text-background-color":"white","text-background-opacity":.7,"text-background-padding":"5px","text-background-shape":"roundrectangle","overlay-opacity":0},highlight:{"font-size":"14px","font-weight":"bold","line-color":"#4763d0","target-arrow-color":"#4763d0"},loop:{"control-point-step-size":70,"loop-direction":"0deg","loop-sweep":"-90deg"}}};var re=.05,ie=47,U=2*Math.PI*ie,de=i=>{let{transactionInfo:r}=i;return"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(`
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" xmlns:xlink="http://www.w3.org/1999/xlink">
${be(r,!r)}
${Se(r,!r)}
</svg>
`)},L=i=>{let{stroke:r,strokeWidth:s,strokeDashOffset:y=0,strokeDashArray:T="none"}=i;return`
`)},G=i=>{let{stroke:r,strokeWidth:s,strokeDashOffset:E=0,strokeDashArray:v="none"}=i;return`
<circle cx="50" cy="50" r="${ie}"

@@ -10,5 +10,5 @@ style="fill:none;

stroke-width:${s};
stroke-dashoffset:${y};
stroke-dasharray:${T} 1000"
stroke-dashoffset:${E};
stroke-dasharray:${v} 1000"
/>
`},ne=(i,r)=>r===0?0:r/i<re?U*re:r/i*U,be=(i,r)=>{let{transactionStatus:s}=G;if(r||!i)return L({stroke:s.default.stroke,strokeWidth:s.default.strokeWidth});{let y=Object.keys(i).reduce((f,k)=>f+i[k],0),T=ne(y,i.slow),v=ne(y,i.bad),A=-1*(.75*U-(T+v)),w=-1*(.75*U-v);return L({stroke:s.good.stroke,strokeWidth:s.good.strokeWidth})+L({stroke:s.slow.stroke,strokeWidth:s.slow.strokeWidth,strokeDashOffset:A,strokeDashArray:T})+L({stroke:s.bad.stroke,strokeWidth:s.bad.strokeWidth,strokeDashOffset:w,strokeDashArray:v})}};var ae=i=>{let{edges:r,nodes:s}=i,y=new Set,w=r.map(t=>t.target).filter(t=>!r.some(n=>n.source===t)).filter(t=>{var n,d;return!((d=(n=s.find(p=>t===p.id))==null?void 0:n.shouldNotMerge)!=null&&d.call(n))}).reduce((t,n)=>t[n]?W(S({},t),{[n]:t[n]+1}):W(S({},t),{[n]:1}),{}),f=Object.entries(w).reduce((t,[n,d])=>{let p=S({},t);return d>1?p.multi.push(n):p.single.push(n),p},{single:[],multi:[]}),k=f.single.reduce((t,n)=>{let{source:d}=r.find(p=>p.target===n);return t[d]?t[d].push(n):t[d]=[n],t},{}),D=f.multi.reduce((t,n)=>{let d=r.filter(p=>p.target===n).map(p=>p.source).sort().toString();return t[d]?t[d].push(n):t[d]=[n],t},{}),R=t=>Object.entries(t).reduce((n,[d,p])=>{let u=S({},n);return p.forEach(h=>{let e=s.find(o=>o.id===h);u[d]?e!=null&&e.type&&u[d][e.type]?u[d][e.type].push(h):e!=null&&e.type&&(u[d][e.type]=[h]):e!=null&&e.type&&(u[d]={},u[d][e.type]=[h])}),u},{}),j=R(k),g=R(D),M=(()=>{let t=[...s],n=[...r];return Object.entries(j).forEach(([d,p])=>{Object.entries(p).forEach(([u,h])=>{var e;if(h.length>1){y.add(u);let o=`${d}_${u}_MergeSingleNodesByServerMap`,E=(e=t.find(l=>l.id===h[0]))==null?void 0:e.imgPath,[c,a]=K.partition(t,l=>!h.includes(l.id));t=[...c,{id:o,imgPath:E,type:u,label:`total: ${h.length}`,nodes:a}];let[m,b]=K.partition(n,l=>!h.includes(l.target));n=[...m,{source:d,target:o,id:`${d}_${u}_MergeSingleEdgesByServerMap`,edges:b}]}})}),{nodes:t,edges:n}})(),P=(()=>{let t=[...M.nodes],n=[...M.edges];return Object.entries(g).forEach(([d,p])=>{Object.entries(p).forEach(([u,h])=>{var e;if(h.length>1){y.add(u);let o=`${d}_${u}_MergeMultiNodesByServerMap`,E=(e=t.find(N=>N.id===h[0]))==null?void 0:e.imgPath,[c,a]=K.partition(t,N=>!h.includes(N.id));t=[...c,{id:o,imgPath:E,type:u,label:`total: ${h.length}`,nodes:a}];let m=d.split(","),[b,l]=K.partition(n,N=>!(m.includes(N.source)&&h.includes(N.target))),$=l.reduce((N,x,_)=>(N[x.source]?N[x.source].edges.push(x):N[x.source]={target:o,source:x.source,id:`${x.source}_${u}_MergeMultiEdgesByServerMap`,edges:[x]},S({},N)),{});n=[...b,...Object.values($)]}})}),{nodes:t,edges:n}})();return{nodes:[...P.nodes.map(t=>({data:W(S({},t),{imgArr:[t==null?void 0:t.imgPath,de(t)]})}))],edges:[...P.edges.map(t=>({data:S({},t)}))],mergeInfo:{types:Array.from(y)}}};import Te from"lodash";var ce=i=>Te.merge({},G,i),q=({cy:i,theme:r,edgeLabelRenderer:s,nodeLabelRenderer:y})=>{var T,v,A;return[{selector:"node",style:W(S({},(T=r.node)==null?void 0:T.default),{width:100,height:100,label:w=>{var k,D;let f=(D=i.data((k=w.data())==null?void 0:k.id))==null?void 0:D.data;return(y==null?void 0:y(f))||(f==null?void 0:f.label)||""},"background-image":w=>{var k,D;let f=(D=i.data((k=w.data())==null?void 0:k.id))==null?void 0:D.data;return f==null?void 0:f.imgArr},"background-fit":"contain","background-offset-y":"-5px"})},{selector:"edge",style:W(S({},(v=r.edge)==null?void 0:v.default),{label:w=>{var k,D;let f=(D=i.data((k=w.data())==null?void 0:k.id))==null?void 0:D.data;return(s==null?void 0:s(f))||""}})},{selector:"edge:loop",style:S({},(A=r.edge)==null?void 0:A.loop)}]};import{keyBy as xe}from"lodash";import{jsx as De}from"react/jsx-runtime";le.use(we);var ve=({data:i,customTheme:r={},baseNodeId:s,onClickNode:y,onClickEdge:T,onClickBackground:v,onDataMerged:A,renderNodeLabel:w,renderEdgeLabel:f,className:k,style:D,cy:R})=>{let j=C.useRef(null),g=C.useRef(),B=C.useRef(),M=ce(r),[J,P]=C.useState("");C.useEffect(()=>()=>{var e;(e=g==null?void 0:g.current)==null||e.destroy()},[]),C.useEffect(()=>{var e,o;P(s),g.current&&((e=B.current)==null||e.removeAllListeners(),(o=B.current)==null||o.stop(),B.current=void 0,g.current.removeData(),g.current.removeAllListeners(),g.current.destroy(),g.current=void 0),g.current=le({zoom:1,minZoom:.1,maxZoom:3,wheelSensitivity:.2,container:j.current}),R==null||R(g.current),g.current.style(q({cy:g.current,theme:M,edgeLabelRenderer:f,nodeLabelRenderer:w})),p()},[s]),C.useEffect(()=>{let e=g.current;e&&e.style(q({cy:e,theme:M,edgeLabelRenderer:f,nodeLabelRenderer:w}))},[w,f]),C.useEffect(()=>{if(i){let e=g.current;if(e){let{nodes:o,edges:E,mergeInfo:c}=ae(i),a;if(A==null||A(c),e.batch(()=>{e.removeData(),e.data(xe([...o,...E],"data.id"));let m=e.nodes().map(l=>l.id()),b=o.map(({data:l})=>l.id);new Set([...m,...b]).forEach(l=>{let $=m.includes(l),N=b.includes(l),x=$&&!N,_=!$&&N;if(x){let O=e.getElementById(l);O.remove(),O.connectedEdges().remove()}else if(_){let{data:O}=o.find(({data:I})=>I.id===l),Y=E.filter(({data:I})=>I.source===l||I.target===l);a=a?[...a,e.add({data:O})]:[e.add({data:O})],Y.forEach(({data:I})=>{let V=e.getElementById(I.source),Q=e.getElementById(I.target);V.inside()&&Q.inside()&&e.add({data:I})})}else return})}),!B.current)B.current=e==null?void 0:e.layout({name:"dagre",fit:!1,rankDir:"LR",rankSep:200}),B.current.run();else if(a&&a.length>0){let m=e.getElementById(s),{x:b,y:l}=m.position(),{y1:$,y2:N}=m.boundingBox(),x;a.forEach(O=>{x=0;let Y=O.predecessors(),I=O.successors(),V=Y.contains(m);x=(V?Y:I).nodes().toArray().findIndex(H=>H.id()===s)+1;let ee=b+x*(200+100)*(V?1:-1),{y:ge}=O.position(),{h:F,y1:ue}=O.boundingBox(),me=F-(ge-ue)*2,te=e.nodes().filter(H=>{let z=H.same(O),{x:Z}=H.position(),pe=H.width(),he=Math.abs(ee-Z)<=pe;return!z&&he}),X;Math.random()>=.5?X=Math.min(...te.map(Z=>Z.position().y-50),l-50)-50-F:X=Math.max(...te.map(z=>z.boundingBox().y2),N)+50;let fe=(F-me)/2+X;O.position({x:ee,y:fe})});let _=e.getElementById(J);_.inside()?_.isNode()?u(_):h(_):e.getElementById(s).emit("tap")}}}},[i]);let t=e=>{y==null||y(e)},n=e=>{T==null||T(e)},d=e=>{v==null||v(e)},p=C.useCallback(()=>{let e=g==null?void 0:g.current;e&&e.on("layoutready",()=>{u(e.getElementById(s));let o=e.getElementById(s);e.resize(),e.center(o)}).on("mouseover",({target:o})=>{e.container().style.cursor=o===e?"default":"pointer"}).on("mouseout",()=>{e.container().style.cursor="default"}).on("tap",({target:o,originalEvent:E,renderedPosition:c})=>{let a=c?"left":"programmatic",m={x:c==null?void 0:c.x,y:c==null?void 0:c.y};o===e?d({eventType:a,position:m}):o.isNode()?(u(o),t({eventType:a,position:m,data:o.data()}),P(o.id())):o.isEdge()&&(h(o),n({eventType:a,position:m,data:o.data()}),P(o.id()))}).on("cxttap",({target:o,renderedPosition:E})=>{let c="right",a={x:E.x,y:E.y};o===e?d({eventType:c,position:a}):o.isNode()?t({eventType:c,position:a,data:o.data()}):o.isEdge()&&n({eventType:c,position:a,data:o.data()})})},[y,T,v]),u=e=>{var E,c,a,m,b;let o=g.current;o.nodes().style((E=M.node)==null?void 0:E.default),o.edges().style((c=M.edge)==null?void 0:c.default),o.getElementById(s).style((a=M.node)==null?void 0:a.main),e.style((m=M.node)==null?void 0:m.highlight),e.connectedEdges().style((b=M.edge)==null?void 0:b.highlight)},h=e=>{var E,c,a,m,b,l;let o=g.current;o.nodes().style((E=M.node)==null?void 0:E.default),o.edges().style((c=M.edge)==null?void 0:c.default),o.getElementById(s).style((a=M.node)==null?void 0:a.main),e.connectedNodes().style({"border-color":(b=(m=M.node)==null?void 0:m.highlight)==null?void 0:b["border-color"]}),e.style((l=M.edge)==null?void 0:l.highlight)};return De("div",{style:S({width:"100%",height:"100%",overflow:"hidden"},D),className:k,ref:j})};export{ve as ServerMap};
`},ne=(i,r)=>r===0?0:r/i<re?U*re:r/i*U,Se=(i,r)=>{let{transactionStatus:s}=z;if(r||!i)return G({stroke:s.default.stroke,strokeWidth:s.default.strokeWidth});{let E=Object.keys(i).reduce((h,S)=>h+i[S],0),v=ne(E,i.slow),O=ne(E,i.bad),B=-1*(.75*U-(v+O)),x=-1*(.75*U-O);return G({stroke:s.good.stroke,strokeWidth:s.good.strokeWidth})+G({stroke:s.slow.stroke,strokeWidth:s.slow.strokeWidth,strokeDashOffset:B,strokeDashArray:v})+G({stroke:s.bad.stroke,strokeWidth:s.bad.strokeWidth,strokeDashOffset:x,strokeDashArray:O})}};var ae=i=>{let{edges:r,nodes:s}=i,E=new Set,x=r.map(t=>t.target).filter(t=>!r.some(n=>n.source===t)).filter(t=>{var n,d;return!((d=(n=s.find(y=>t===y.id))==null?void 0:n.shouldNotMerge)!=null&&d.call(n))}).reduce((t,n)=>t[n]?P(w({},t),{[n]:t[n]+1}):P(w({},t),{[n]:1}),{}),h=Object.entries(x).reduce((t,[n,d])=>{let y=w({},t);return d>1?y.multi.push(n):y.single.push(n),y},{single:[],multi:[]}),S=h.single.reduce((t,n)=>{let{source:d}=r.find(y=>y.target===n);return t[d]?t[d].push(n):t[d]=[n],t},{}),I=h.multi.reduce((t,n)=>{let d=r.filter(y=>y.target===n).map(y=>y.source).sort().toString();return t[d]?t[d].push(n):t[d]=[n],t},{}),$=t=>Object.entries(t).reduce((n,[d,y])=>{let g=w({},n);return y.forEach(m=>{let e=s.find(o=>o.id===m);g[d]?e!=null&&e.type&&g[d][e.type]?g[d][e.type].push(m):e!=null&&e.type&&(g[d][e.type]=[m]):e!=null&&e.type&&(g[d]={},g[d][e.type]=[m])}),g},{}),L=$(S),u=$(I),k=(()=>{let t=[...s],n=[...r];return Object.entries(L).forEach(([d,y])=>{Object.entries(y).forEach(([g,m])=>{var e;if(m.length>1){E.add(g);let o=`${d}_${g}_MergeSingleNodesByServerMap`,N=(e=t.find(l=>l.id===m[0]))==null?void 0:e.imgPath,[c,a]=K.partition(t,l=>!m.includes(l.id));t=[...c,{id:o,imgPath:N,type:g,label:`total: ${m.length}`,nodes:a}];let[f,b]=K.partition(n,l=>!m.includes(l.target));n=[...f,{source:d,target:o,id:`${d}_${g}_MergeSingleEdgesByServerMap`,edges:b}]}})}),{nodes:t,edges:n}})(),j=(()=>{let t=[...k.nodes],n=[...k.edges];return Object.entries(u).forEach(([d,y])=>{Object.entries(y).forEach(([g,m])=>{var e;if(m.length>1){E.add(g);let o=`${d}_${g}_MergeMultiNodesByServerMap`,N=(e=t.find(M=>M.id===m[0]))==null?void 0:e.imgPath,[c,a]=K.partition(t,M=>!m.includes(M.id));t=[...c,{id:o,imgPath:N,type:g,label:`total: ${m.length}`,nodes:a}];let f=d.split(","),[b,l]=K.partition(n,M=>!(f.includes(M.source)&&m.includes(M.target))),V=l.reduce((M,D,A)=>(M[D.source]?M[D.source].edges.push(D):M[D.source]={target:o,source:D.source,id:`${D.source}_${g}_MergeMultiEdgesByServerMap`,edges:[D]},w({},M)),{});n=[...b,...Object.values(V)]}})}),{nodes:t,edges:n}})();return{nodes:[...j.nodes.map(t=>({data:P(w({},t),{imgArr:[t==null?void 0:t.imgPath,de(t)]})}))],edges:[...j.edges.map(t=>({data:w({},t)}))],mergeInfo:{types:Array.from(E)}}};import Te from"lodash";var ce=i=>Te.merge({},z,i),q=({cy:i,theme:r,edgeLabelRenderer:s,nodeLabelRenderer:E})=>{var v,O,B;return[{selector:"node",style:P(w({},(v=r.node)==null?void 0:v.default),{width:100,height:100,label:x=>{var S,I;let h=(I=i.data((S=x.data())==null?void 0:S.id))==null?void 0:I.data;return(E==null?void 0:E(h))||(h==null?void 0:h.label)||""},"background-image":x=>{var S,I;let h=(I=i.data((S=x.data())==null?void 0:S.id))==null?void 0:I.data;return h==null?void 0:h.imgArr},"background-fit":"contain","background-offset-y":"-5px"})},{selector:"edge",style:P(w({},(O=r.edge)==null?void 0:O.default),{label:x=>{var S,I;let h=(I=i.data((S=x.data())==null?void 0:S.id))==null?void 0:I.data;return(s==null?void 0:s(h))||""}})},{selector:"edge:loop",style:w({},(B=r.edge)==null?void 0:B.loop)}]};import{keyBy as ve}from"lodash";import{jsx as De}from"react/jsx-runtime";le.use(we);var xe=({data:i,customTheme:r={},baseNodeId:s,onClickNode:E,onClickEdge:v,onClickBackground:O,onDataMerged:B,renderNodeLabel:x,renderEdgeLabel:h,className:S,style:I,cy:$})=>{let L=_.useRef(null),u=_.useRef(),R=_.useRef(),k=ce(r),[J,j]=_.useState("");_.useEffect(()=>()=>{var e;(e=u==null?void 0:u.current)==null||e.destroy()},[]),_.useEffect(()=>{var e,o;j(s),u.current&&((e=R.current)==null||e.removeAllListeners(),(o=R.current)==null||o.stop(),R.current=void 0,u.current.removeData(),u.current.removeAllListeners(),u.current.destroy(),u.current=void 0),u.current=le({zoom:1,minZoom:.1,maxZoom:3,wheelSensitivity:.2,container:L.current}),$==null||$(u.current),u.current.style(q({cy:u.current,theme:k,edgeLabelRenderer:h,nodeLabelRenderer:x})),y()},[s]),_.useEffect(()=>{let e=u.current;e&&e.style(q({cy:e,theme:k,edgeLabelRenderer:h,nodeLabelRenderer:x}))},[x,h]),_.useEffect(()=>{if(i){let e=u.current;if(e){let{nodes:o,edges:N,mergeInfo:c}=ae(i),a;if(B==null||B(c),e.batch(()=>{e.removeData(),e.data(ve([...o,...N],"data.id"));let f=e.nodes().map(l=>l.id()),b=o.map(({data:l})=>l.id);new Set([...f,...b]).forEach(l=>{let V=f.includes(l),M=b.includes(l),D=V&&!M,A=!V&&M;if(D){let p=e.getElementById(l);p.remove(),p.connectedEdges().remove()}else if(A){let{data:p}=o.find(({data:T})=>T.id===l),C=N.filter(({data:T})=>T.source===l||T.target===l);a=a?[...a,e.add({data:p})]:[e.add({data:p})],C.forEach(({data:T})=>{let H=e.getElementById(T.source),Q=e.getElementById(T.target);H.inside()&&Q.inside()&&e.add({data:T})})}else return})}),!R.current)R.current=e==null?void 0:e.layout({name:"dagre",fit:!1,rankDir:"LR",rankSep:200}),R.current.run();else if(a&&a.length>0){let f=e.getElementById(s),{x:b,y:l}=f.position(),{y1:V,y2:M}=f.boundingBox(),D;a.forEach(p=>{D=0;let C=p.predecessors(),T=p.successors(),H=C.contains(f);D=(H?C:T).nodes().toArray().findIndex(W=>W.id()===s)+1;let ee=b+D*(200+100)*(H?1:-1),{y:ge}=p.position(),{h:F,y1:ue}=p.boundingBox(),me=F-(ge-ue)*2,te=e.nodes().filter(W=>{let Y=W.same(p),{x:Z}=W.position(),pe=W.width(),he=Math.abs(ee-Z)<=pe;return!Y&&he}),X;Math.random()>=.5?X=Math.min(...te.map(Z=>Z.position().y-50),l-50)-50-F:X=Math.max(...te.map(Y=>Y.boundingBox().y2),M)+50;let fe=(F-me)/2+X;p.position({x:ee,y:fe})});let A=e.getElementById(J);if(A.isNode()){let p=A.data("nodes");p?o.some(C=>C.data.nodes&&C.data.nodes.length===p.length&&C.data.nodes.every(({id:T})=>p.some(({id:H})=>T===H)))?g(A):e.getElementById(s).emit("tap"):A.inside()?g(A):e.getElementById(s).emit("tap")}else{let p=A.data("edges");p?N.some(C=>C.data.edges&&C.data.edges.length===p.length&&C.data.edges.every(({id:T})=>p.some(({id:H})=>T===H)))?m(A):e.getElementById(s).emit("tap"):A.inside()?m(A):e.getElementById(s).emit("tap")}}}}},[i]);let t=e=>{E==null||E(e)},n=e=>{v==null||v(e)},d=e=>{O==null||O(e)},y=_.useCallback(()=>{let e=u==null?void 0:u.current;e&&e.on("layoutready",()=>{g(e.getElementById(s));let o=e.getElementById(s);e.resize(),e.center(o)}).on("mouseover",({target:o})=>{e.container().style.cursor=o===e?"default":"pointer"}).on("mouseout",()=>{e.container().style.cursor="default"}).on("tap",({target:o,originalEvent:N,renderedPosition:c})=>{let a=c?"left":"programmatic",f={x:c==null?void 0:c.x,y:c==null?void 0:c.y};o===e?d({eventType:a,position:f}):o.isNode()?(g(o),t({eventType:a,position:f,data:o.data()}),j(o.id())):o.isEdge()&&(m(o),n({eventType:a,position:f,data:o.data()}),j(o.id()))}).on("cxttap",({target:o,renderedPosition:N})=>{let c="right",a={x:N.x,y:N.y};o===e?d({eventType:c,position:a}):o.isNode()?t({eventType:c,position:a,data:o.data()}):o.isEdge()&&n({eventType:c,position:a,data:o.data()})})},[E,v,O]),g=e=>{var N,c,a,f,b;let o=u.current;o.nodes().style((N=k.node)==null?void 0:N.default),o.edges().style((c=k.edge)==null?void 0:c.default),o.getElementById(s).style((a=k.node)==null?void 0:a.main),e.style((f=k.node)==null?void 0:f.highlight),e.connectedEdges().style((b=k.edge)==null?void 0:b.highlight)},m=e=>{var N,c,a,f,b,l;let o=u.current;o.nodes().style((N=k.node)==null?void 0:N.default),o.edges().style((c=k.edge)==null?void 0:c.default),o.getElementById(s).style((a=k.node)==null?void 0:a.main),e.connectedNodes().style({"border-color":(b=(f=k.node)==null?void 0:f.highlight)==null?void 0:b["border-color"]}),e.style((l=k.edge)==null?void 0:l.highlight)};return De("div",{style:w({width:"100%",height:"100%",overflow:"hidden"},I),className:S,ref:L})};export{xe as ServerMap};
{
"name": "@pinpoint-fe/server-map",
"version": "0.0.10-rc.2",
"version": "0.0.10-rc.3",
"description": "Open-source network-map library, specifically for application topology, written in React.js",

@@ -5,0 +5,0 @@ "repository": "https://github.com/pinpoint-apm/pinpoint/blob/frontend-v3/web-frontend/src/main/v3/packages/server-map/README.md",

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