"use strict";(self.webpackChunkgine=self.webpackChunkgine||[]).push([[164],{164:(e,t,l)=>{l.r(t),l.d(t,{HelloModel:()=>n,HelloView:()=>a,NetlistGraphModel:()=>c,NetlistGraphView:()=>u,version:()=>i.i8});var o=l(672);class n extends o.DOMWidgetModel{defaults(){return{...super.defaults(),_model_name:"HelloModel",_view_name:"HelloView",_model_module:"gine",_view_module:"gine",_model_module_version:'"0.0.8"',_view_module_version:'"0.0.8"',value:"Hello World!"}}}class a extends o.DOMWidgetView{render(){this.value_changed(),this.model.on("change:value",this.value_changed,this)}value_changed(){this.el.textContent=this.model.get("value")}}const i={i8:"0.0.8"};var r=l(407);let s=function(e,{nodes:t,links:l},{nodeClassName:o=(e=>e.className),nodeId:n=(e=>e.id),nodeGroup:a,nodeGroups:i,nodeHierarchy:s=(e=>e.hierarchy),nodeTitle:d,nodeFill:c="currentColor",nodeStroke:u="#fff",nodeStrokeWidth:h=1.5,nodeStrokeOpacity:g=1,nodeRadius:p=5,nodeStrength:m,linkHierarchy:f=(e=>e.hierarchy),linkSource:_=(({source:e})=>e),linkTarget:k=(({target:e})=>e),linkStroke:v="#999",linkStrokeOpacity:w=.6,linkStrokeWidth:y=1.5,linkStrokeLinecap:x="round",linkStrength:b,colors:j=r.schemeTableau10,width:S=640,height:M=400,invalidation:N}={}){console.log("Rendering force graph");const O=r.map(t,s).map(P),C=r.map(t,o).map(P),H=r.map(l,f).map(P);console.log("hey force graph");const W=r.map(t,n).map(P),A=r.map(l,_).map(P),G=r.map(l,k).map(P);void 0===d&&(d=(e,t)=>W[t]);const V=null==d?null:r.map(t,d),T=null==a?null:r.map(t,a).map(P),D="function"!=typeof y?null:r.map(l,y),B="function"!=typeof v?null:r.map(l,v);t=r.map(t,((e,t)=>({id:W[t],hierarchy:O[t],className:C[t]}))),l=r.map(l,((e,t)=>({source:A[t],target:G[t],hierarchy:H[t]}))),T&&void 0===i&&(i=r.sort(T));const L=null==a?null:r.scaleOrdinal(i,j),R=r.forceManyBody(),z=r.forceLink(l).id((({index:e})=>W[e]));void 0!==m&&R.strength(m),void 0!==b&&z.strength(b);const E=r.forceSimulation(t).force("link",z).force("charge",R).force("center",r.forceCenter()).on("tick",(function(){q.attr("x1",(e=>e.source.x)).attr("y1",(e=>e.source.y)).attr("x2",(e=>e.target.x)).attr("y2",(e=>e.target.y)),J.attr("cx",(e=>e.x)).attr("cy",(e=>e.y)),K.attr("x",(e=>e.x)).attr("y",(e=>e.y))})),F=document.createElementNS("http://www.w3.org/2000/svg","svg");F.setAttribute("width",S),F.setAttribute("height",M),e.el.appendChild(F),e.el.setAttribute("class","jupyter-widget gine");const I=r.select(F);I.attr("viewBox",[-S/2,-M/2,S,M]).attr("style","max-width: 100%; height: auto; height: intrinsic;"),window.svg=I;const q=I.append("g").attr("stroke","function"!=typeof v?v:null).attr("stroke-opacity",w).attr("stroke-width","function"!=typeof y?y:null).attr("stroke-linecap",x).selectAll("line").data(l).join("line"),J=I.append("g").attr("fill",c).attr("stroke",u).attr("stroke-opacity",g).attr("stroke-width",h).selectAll("circle").data(t).join("circle").attr("r",p).call(function(e){return r.drag().on("start",(function(t){t.active||e.alphaTarget(.3).restart(),t.subject.fx=t.subject.x,t.subject.fy=t.subject.y})).on("drag",(function(e){e.subject.fx=e.x,e.subject.fy=e.y})).on("end",(function(t){t.active||e.alphaTarget(0),t.subject.fx=null,t.subject.fy=null}))}(E)),K=I.append("g").selectAll("text").data(t).enter().append("text").text((e=>e.className)).attr("font-size",15).attr("dx",15).attr("dy",4);function P(e){return null!==e&&"object"==typeof e?e.valueOf():e}return console.log(t),console.log(l),console.log(t),D&&q.attr("stroke-width",(({index:e})=>D[e])),B&&q.attr("stroke",(({index:e})=>B[e])),T&&J.attr("fill",(({index:e})=>L(T[e]))),V&&J.append("title").text((({index:e})=>V[e])),null!=N&&N.then((()=>E.stop())),console.log("end create"),Object.assign(I.node(),{scales:{color:L}})},d=s;console.log("NetworkLattice example file");class c extends o.DOMWidgetModel{defaults(){return{...super.defaults(),_model_name:"NetlistGraphModel",_view_name:"NetlistGraphView",_model_module:"gine",_view_module:"gine",_model_module_version:"0.0.8",_view_module_version:"0.0.8",value:{nodes:[],links:[]},netlist_graph_data:{nodes:[],links:[]}}}}class u extends o.DOMWidgetView{render(){console.log("Rendering network lattice"),console.log(this.model.get("netlist_graph_data")),console.log(this.model.get("value"));let e=this.model.get("netlist_graph_data");d(this,e),this.model.on("change:netlist_graph_data",this.value_changed,this),window.dom=this.el,console.log("Built network lattice")}value_changed(){(function(e,t){console.log("value changed"),s(e,t)})(this,this.model.get("netlist_graph_data")),console.log("Changed network lattice")}}}}]);