varlabelType='Native',useGradients=true,nativeTextSupport=true,animate=true;$morph('jitXeno').removeHTMLContent();$morph('jitXeno').setupHTMLContent();$morph('jitXeno').setFill(Color.gray.darker())//Datajson=[]this.world().withAllSubmorphsDo(function(){varea=this;json.push({"adjacencies":ea.submorphs.collect(function(ea){returnea.id()}),data:{"$color":"gray","$type":"circle","$dim":(2*this.submorphs.length)+1},id:ea.id(),name:ea.constructor.name,})});json//initForceDirectedvarfd=new$jit.ForceDirected({//idofthevisualizationcontainerinjectInto:'infovis',//Enablezoomingandpanning//byscrollingandDnDNavigation:{enable:true,//Enablepanningeventsonlyifwe'redraggingtheempty//canvas(andnotanode).panning:'avoidnodes',zooming:10//zoomspeed.higherismoresensible},//Changenodeandedgestylessuchas//colorandwidth.//Thesepropertiesarealsosetpernode//withdollarprefixeddata-propertiesinthe//JSONstructure.Node:{overridable:true},Edge:{overridable:true,color:'#23A4FF',lineWidth:0.4},//NativecanvastextstylingLabel:{type:labelType,//NativeorHTMLsize:10,style:'bold'},//AddTipsTips:{enable:true,onShow:function(tip,node){//countconnectionsvarcount=0;node.eachAdjacency(function(){count++;});//displaynodeinfointooltiptip.innerHTML="<divclass=\"tip-title\">"+node.name+"</div>"+"<divclass=\"tip-text\"><b>connections:</b>"+count+"</div>";}},//AddnodeeventsEvents:{enable:true,//ChangecursorstylewhenhoveringanodeonMouseEnter:function(){fd.canvas.getElement().style.cursor='move';},onMouseLeave:function(){fd.canvas.getElement().style.cursor='';},//UpdatenodepositionswhendraggedonDragMove:function(node,eventInfo,e){varpos=eventInfo.getPos();node.pos.setc(pos.x,pos.y);fd.plot();},//ImplementthesamehandlerfortouchscreensonTouchMove:function(node,eventInfo,e){$jit.util.event.stop(e);//stopdefaulttouchmoveeventthis.onDragMove(node,eventInfo,e);},//AddalsoaclickhandlertonodesonClick:function(node){if(!node)return;//Buildtherightcolumnrelationslist.//Thisisdonebytraversingtheclickednodeconnections.varhtml="<h4>"+node.name+"</h4><b>connections:</b><ul><li>",list=[];node.eachAdjacency(function(adj){list.push(adj.nodeTo.name);});//appendconnectionsinformation$jit.id('inner-details').innerHTML=html+list.join("</li><li>")+"</li></ul>";}},//NumberofiterationsfortheFDalgorithmiterations:200,//EdgelengthlevelDistance:130,//Addtexttothelabels.Thismethodisonlytriggered//onlabelcreationandonlyforDOMlabels(notnativecanvasones).onCreateLabel:function(domElement,node){domElement.innerHTML=node.name;varstyle=domElement.style;style.fontSize="0.8em";style.color="#ddd";},//ChangenodestyleswhenDOMlabelsareplaced//ormoved.onPlaceLabel:function(domElement,node){varstyle=domElement.style;varleft=parseInt(style.left);vartop=parseInt(style.top);varw=domElement.offsetWidth;style.left=(left-w/2)+'px';style.top=(top+10)+'px';style.display='';}});//loadJSONdata.fd.loadJSON(json);//computepositionsincrementallyandanimate.fd.computeIncremental({iter:40,property:'end',onStep:function(perc){Log.write(perc+'%loaded...');},onComplete:function(){Log.write('done');fd.animate({modes:['linear'],transition:$jit.Trans.Elastic.easeOut,duration:2500});}});//end\" + node.name + \"\"\n        + \"connections: \" + count + \"
\";\n    }\n  },\n  // Add node events\n  Events: {\n    enable: true,\n    //Change cursor style when hovering a node\n    onMouseEnter: function() {\n      fd.canvas.getElement().style.cursor = 'move';\n    },\n    onMouseLeave: function() {\n      fd.canvas.getElement().style.cursor = '';\n    },\n    //Update node positions when dragged\n    onDragMove: function(node, eventInfo, e) {\n      var pos = eventInfo.getPos();\n      node.pos.setc(pos.x, pos.y);\n      fd.plot();\n    },\n    //Implement the same handler for touchscreens\n    onTouchMove: function(node, eventInfo, e) {\n      $jit.util.event.stop(e); //stop default touchmove event\n      this.onDragMove(node, eventInfo, e);\n    },\n    //Add also a click handler to nodes\n    onClick: function(node) {\n      if(!node) return;\n      // Build the right column relations list.\n      // This is done by traversing the clicked node connections.\n      var html = \"\" + node.name + \"
 connections:- \",\n          list = [];\n      node.eachAdjacency(function(adj){\n        list.push(adj.nodeTo.name);\n      });\n      //append connections information\n      $jit.id('inner-details').innerHTML = html + list.join(\"
 - \") + \"
 
\";\n    }\n  },\n  //Number of iterations for the FD algorithm\n  iterations: 200,\n  //Edge length\n  levelDistance: 130,\n  // Add text to the labels. This method is only triggered\n  // on label creation and only for DOM labels (not native canvas ones).\n  onCreateLabel: function(domElement, node){\n    domElement.innerHTML = node.name;\n    var style = domElement.style;\n    style.fontSize = \"0.8em\";\n    style.color = \"#ddd\";\n  },\n  // Change node styles when DOM labels are placed\n  // or moved.\n  onPlaceLabel: function(domElement, node){\n    var style = domElement.style;\n    var left = parseInt(style.left);\n    var top = parseInt(style.top);\n    var w = domElement.offsetWidth;\n    style.left = (left - w / 2) + 'px';\n    style.top = (top + 10) + 'px';\n    style.display = '';\n  }\n});\n// load JSON data.\nfd.loadJSON(json);\n// compute positions incrementally and animate.\nfd.computeIncremental({\n  iter: 40,\n  property: 'end',\n  onStep: function(perc){\n    Log.write(perc + '% loaded...');\n  },\n  onComplete: function(){\n    Log.write('done');\n    fd.animate({\n      modes: ['linear'],\n      transition: $jit.Trans.Elastic.easeOut,\n      duration: 2500\n    });\n  }\n});\n// end\n"]]>147truetruefalse\" + node.name + \"\"\n        + \"connections: \" + count + \"
\";\n    }\n  },\n  // Add node events\n  Events: {\n    enable: true,\n    //Change cursor style when hovering a node\n    onMouseEnter: function() {\n      fd.canvas.getElement().style.cursor = 'move';\n    },\n    onMouseLeave: function() {\n      fd.canvas.getElement().style.cursor = '';\n    },\n    //Update node positions when dragged\n    onDragMove: function(node, eventInfo, e) {\n      var pos = eventInfo.getPos();\n      node.pos.setc(pos.x, pos.y);\n      fd.plot();\n    },\n    //Implement the same handler for touchscreens\n    onTouchMove: function(node, eventInfo, e) {\n      $jit.util.event.stop(e); //stop default touchmove event\n      this.onDragMove(node, eventInfo, e);\n    },\n    //Add also a click handler to nodes\n    onClick: function(node) {\n      if(!node) return;\n      // Build the right column relations list.\n      // This is done by traversing the clicked node connections.\n      var html = \"\" + node.name + \"
 connections:- \",\n          list = [];\n      node.eachAdjacency(function(adj){\n        list.push(adj.nodeTo.name);\n      });\n      //append connections information\n      $jit.id('inner-details').innerHTML = html + list.join(\"
 - \") + \"
 
\";\n    }\n  },\n  //Number of iterations for the FD algorithm\n  iterations: 200,\n  //Edge length\n  levelDistance: 130,\n  // Add text to the labels. This method is only triggered\n  // on label creation and only for DOM labels (not native canvas ones).\n  onCreateLabel: function(domElement, node){\n    domElement.innerHTML = node.name;\n    var style = domElement.style;\n    style.fontSize = \"0.8em\";\n    style.color = \"#ddd\";\n  },\n  // Change node styles when DOM labels are placed\n  // or moved.\n  onPlaceLabel: function(domElement, node){\n    var style = domElement.style;\n    var left = parseInt(style.left);\n    var top = parseInt(style.top);\n    var w = domElement.offsetWidth;\n    style.left = (left - w / 2) + 'px';\n    style.top = (top + 10) + 'px';\n    style.display = '';\n  }\n});\n// load JSON data.\nfd.loadJSON(json);\n// compute positions incrementally and animate.\nfd.computeIncremental({\n  iter: 40,\n  property: 'end',\n  onStep: function(perc){\n    Log.write(perc + '% loaded...');\n  },\n  onComplete: function(){\n    Log.write('done');\n    fd.animate({\n      modes: ['linear'],\n      transition: $jit.Trans.Elastic.easeOut,\n      duration: 2500\n    });\n  }\n});\n// end\n"]]>