3
Â”“^y  ã               @   s@   d dl T d dlZd dljjZd dlZd dlZG dd„ de	ƒZ
dS )é    )Ú*Nc               @   s   e Zd Zdd„ ZdS )ÚRandomGraphsc       	      C   s  dd l }tttttg}tjjt	|j ƒ ƒƒ t
jddƒ}x |jjƒ D ]}tj|ƒ|d< qBW tj|ƒ}| jdd„ |D ƒŽ  | jdƒ |jƒ }tj|ƒ t
jddƒ}|j|jƒ x"|jD ]}||jkr²|j|Ž  q²W x |jjƒ D ]}tj|ƒ|d< qÚW | jtj||ƒŽ  | jdƒ d S )Nr   é
   g      à?Úcolorc             S   s   g | ]}t |ƒ‘qS © )ÚShowCreation)Ú.0Úmr   r   úmanimnx/example.pyú
<listcomp>   s    z*RandomGraphs.construct.<locals>.<listcomp>é   )ÚtimeZREDZBLUEZGREENÚORANGEZYELLOWÚnpÚrandomÚseedÚintÚnxZerdos_renyi_graphZnodesÚvaluesÚchoiceÚmnxZ
ManimGraphÚplayÚwaitÚcopyZassign_positionsZadd_edges_fromÚedgesZremove_edgeZtransform_graph)	Úselfr   ZCOLORSZG1ÚnodeZmngZG2Znew_GÚedger   r   r
   Ú	construct
   s(    



zRandomGraphs.constructN)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r
   r      s   r   )Zmanimlib.importsZnetworkxr   Zmanimnx.manimnx.manimnxZmanimnxr   Únumpyr   r   ÚScener   r   r   r   r
   Ú<module>   s
   