BFj*ddlZGddeZdS)NceZdZdZdZdZGddeZGddeZGdd eZ Gd d eZ Gd d eZ dZ dZ dZdZdZdZdZdS)PhysicsFc|j|SN__dict__selfitems ;C:\PYTHON\_runtimes\venv\Lib\site-packages\pyvis/physics.py __getitem__zPhysics.__getitem__s}T""c*t|jSr)strrr s r __repr__zPhysics.__repr__ s4=!!!rceZdZdZdZdS)Physics.barnesHutzt BarnesHut is a quadtree based gravity model. This is the fastest, default and recommended. c|d|_|d|_|d|_|d|_|d|_|d|_dSNgravitycentral_gravity spring_lengthspring_strengthdampingoverlapgravitationalConstantcentralGravity springLengthspringConstantr avoidOverlapr paramss r __init__zPhysics.barnesHut.__init__W)/ ):D &"():";D  & 7D "():";D !),DL &y 1D   rN__name__ __module__ __qualname____doc__r%rr barnesHutrs-   2 2 2 2 2rr-ceZdZdZdZdS)Physics.forceAtlas2Baseda  Force Atlas 2 has been develoved by Jacomi et all (2014) for use with Gephi. The force Atlas based solver makes use of some of the equations provided by them and makes use of some of the barnesHut implementation in vis. The Main differences are the central gravity model, which is here distance independent, and repulsion being linear instead of quadratic. Finally, all node masses have a multiplier based on the amount of connected edges plus one. c|d|_|d|_|d|_|d|_|d|_|d|_dSrrr#s r r%z!Physics.forceAtlas2Based.__init__(r&rNr'r,rr forceAtlas2Basedr/s-  2 2 2 2 2rr1ceZdZdZdZdS)Physics.Repulsionz The repulsion model assumes nodes have a simplified field around them. Its force lineraly decreases from 1 (at 0.5*nodeDistace and smaller) to 0 (at 2*nodeDistance) c|d|_|d|_|d|_|d|_|d|_dSN node_distancerrrr nodeDistancerr r!rr#s r r%zPhysics.Repulsion.__init__6H & 7D "():";D  & 7D "():";D !),DLLLrNr'r,rr Repulsionr30-   - - - - -rr:ceZdZdZdZdS)Physics.hierarchicalRepulsionz This model is based on the repulsion solver but the levels are taken into accound and the forces are normalized. c|d|_|d|_|d|_|d|_|d|_dSr5r7r#s r r%z&Physics.hierarchicalRepulsion.__init__Cr9rNr'r,rr hierarchicalRepulsionr==r;rr?c$eZdZdZdZdZdZdS)Physics.StabilizationzS This makes the network stabilized on load using default settings. c|j|Srrr s r r z!Physics.Stabilization.__getitem__Ns=& &rcLd|_d|_d|_d|_d|_dS)NTi2F)enabled iterationsupdateIntervalonlyDynamicEdgesfitrs r r%zPhysics.Stabilization.__init__Qs+DL"DO"$D $)D !DHHHrc||_dSr)rEr statuss r toggle_stabilizationz*Physics.Stabilization.toggle_stabilizationXs !DLLLrN)r(r)r*r+r r%rMr,rr StabilizationrAJsK   ' ' '    " " " " "rrNcFd|_||_dS)NT)rErN stabilizationrs r r%zPhysics.__init__[s# !//11rc:|||_dSr)r-r#s r use_barnes_hutzPhysics.use_barnes_hut_s//rcH|||_d|_dS)Nr1)r1solverr#s r use_force_atlas_2basedzPhysics.use_force_atlas_2basedbs# $ 5 5f = =( rcH|||_d|_dS)N repulsion)r:rWrTr#s r use_repulsionzPhysics.use_repulsionfs //! rcH|||_d|_dS)Nr?)r?rTr#s r use_hrepulsionzPhysics.use_hrepulsionjs#%)%?%?%G%G"- rc:|j|dSr)rPrMrKs r rMzPhysics.toggle_stabilizationns //77777rc4tj|dddS)Nc|jSrr)os r z!Physics.to_json..ssAJrT)default sort_keysindent)jsondumpsrs r to_jsonzPhysics.to_jsonqs)z ..1&&& &rN)r(r)r* engine_chosenr robjectr-r1r:r?rNr%rRrUrXrZrMrfr,rr rrsrM###""" 2 2 2 2 2F 2 2 2222226222& - - - - -F - - - - - - - - - - -"""""""""222000)))"""...888&&&&&rr)rdrhrr,rr risL p&p&p&p&p&fp&p&p&p&p&r