1 line
12 KiB
JavaScript
1 line
12 KiB
JavaScript
|
|
"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[9395],{21307:(e,t,n)=>{n.d(t,{c:()=>c});var r=n(99250);var i=n(15220);var a=4;function o(e){return(0,i.Z)(e,a)}const s=o;var d=n(30014);var l=n(85389);function c(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:h(e),edges:g(e)};if(!r.Z(e.graph())){t.value=s(e.graph())}return t}function h(e){return d.Z(e.nodes(),(function(t){var n=e.node(t);var i=e.parent(t);var a={v:t};if(!r.Z(n)){a.value=n}if(!r.Z(i)){a.parent=i}return a}))}function g(e){return d.Z(e.edges(),(function(t){var n=e.edge(t);var i={v:t.v,w:t.w};if(!r.Z(t.name)){i.name=t.name}if(!r.Z(n)){i.value=n}return i}))}function f(e){var t=new Graph(e.options).setGraph(e.value);_.each(e.nodes,(function(e){t.setNode(e.v,e.value);if(e.parent){t.setParent(e.v,e.parent)}}));_.each(e.edges,(function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}));return t}},29395:(e,t,n)=>{n.d(t,{r:()=>G});var r=n(96001);var i=n(21307);var a=n(27734);var o=n(23787);var s=n(67058);var d=n(73711);var l=n(34596);let c={};let h={};let g={};const f=()=>{h={};g={};c={}};const u=(e,t)=>{o.l.trace("In isDecendant",t," ",e," = ",h[t].includes(e));if(h[t].includes(e)){return true}return false};const w=(e,t)=>{o.l.info("Decendants of ",t," is ",h[t]);o.l.info("Edge is ",e);if(e.v===t){return false}if(e.w===t){return false}if(!h[t]){o.l.debug("Tilt, ",t,",not in decendants");return false}return h[t].includes(e.v)||u(e.v,t)||u(e.w,t)||h[t].includes(e.w)};const p=(e,t,n,r)=>{o.l.warn("Copying children of ",e,"root",r,"data",t.node(e),r);const i=t.children(e)||[];if(e!==r){i.push(e)}o.l.warn("Copying (nodes) clusterId",e,"nodes",i);i.forEach((i=>{if(t.children(i).length>0){p(i,t,n,r)}else{const a=t.node(i);o.l.info("cp ",i," to ",r," with parent ",e);n.setNode(i,a);if(r!==t.parent(i)){o.l.warn("Setting parent",i,t.parent(i));n.setParent(i,t.parent(i))}if(e!==r&&i!==e){o.l.debug("Setting parent",i,e);n.setParent(i,e)}else{o.l.info("In copy ",e,"root",r,"data",t.node(e),r);o.l.debug("Not Setting parent for node=",i,"cluster!==rootId",e!==r,"node!==clusterId",i!==e)}const s=t.edges(i);o.l.debug("Copying Edges",s);s.forEach((i=>{o.l.info("Edge",i);const a=t.edge(i.v,i.w,i.name);o.l.info("Edge data",a,r);try{if(w(i,r)){o.l.info("Copying as ",i.v,i.w,a,i.name);n.setEdge(i.v,i.w,a,i.name);o.l.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]))}else{o.l.info("Skipping copy of edge ",i.v,"--\x3e",i.w," rootId: ",r," clusterId:",e)}}catch(s){o.l.error(s)}}))}o.l.debug("Removing node",i);t.removeNode(i)}))};const v=(e,t)=>{const n=t.children(e);let r=[...n];for(const i of n){g[i]=e;r=[...r,...v(i,t)]}return r};const y=(e,t)=>{o.l.trace("Searching",e);const n=t.children(e);o.l.trace("Searching children of id ",e,n);if(n.length<1){o.l.trace("This is a valid node",e);return e}for(const r of n){const n=y(r,t);if(n){o.l.trace("Found replacement for",e," => ",n);return n}}};const m=e=>{if(!c[e]){return e}if(!c[e].externalConnections){return e}if(c[e]){return c[e].id}return e};const x=(e,t)=>{if(!e||t>10){o.l.debug("Opting out, no graph ");return}else{o.l.debug("Opting in, graph ")}e.nodes().forEach((function(t){const n=e.children(t);if(n.length>0){o.l.warn("Cluster identified",t," Replacement id in edges: ",y(t,e));h[t]=v(t,e);c[t]={id:y(t,e),clusterData:e.node(t)}}}));e.nodes().forEach((function(t){const n=e.children(t);const r=e.edges();if(n.length>0){o.l.debug("Cluster identified",t,h);r.forEach((e=>{if(e.v!==t&&e.w!==t){const n=u(e.v,t);const r=u(e.w,t);if(n^r){o.l.warn("Edge: ",e," leaves cluster ",t);o.l.warn("Decendants of XXX ",t,": ",h[t]);c[t].externalConnections=true}}}))}else{o.l.debug("Not a cluster ",t,h)}}));e.edges().forEach((function(t){const n=e.edge(t);o.l.warn("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t));o.l.warn("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(e.edge(t)));let r=t.v;let i=t.w;o.l.warn("Fix XXX",c,"ids:",t.v,t.w,"Translating: ",c[t.v]," --- ",c[t.w]);if(c[t.v]&&c[t.w]&&c[t.v]===c[t.w]){o.l.warn("Fixing and trixin
|