+
    �°³jÑ  ã                   óX   € ^ RI tRR.tRR lt]P                  ! RRR7      RR l4       tR# )	é    NÚcytoscape_dataÚcytoscape_graphc                ó  € W8X  d   \         P                  ! R4      hR\        V P                  P	                  4       4      /pV P                  4       VR&   V P                  4       VR&   R. R. /VR&   VR,          R,          pVR,          R,          pV P                  P	                  4        F�  w  rgRVP                  4       /pVP                  V4      ;'       g    \        V4      VR,          R&   WhR,          R	&   VP                  V4      ;'       g    \        V4      VR,          R
&   VP                  V4       K‘  	  V P                  4       '       d¬   V P                  RR7       F“  p	RV P                  V	^ ,          ,          V	^,          ,          V	^,          ,          P                  4       /pV	^ ,          VR,          R&   V	^,          VR,          R&   V	^,          VR,          R&   VP                  V4       K•  	  V# V P                  4        Fr  p	RV P                  V	^ ,          ,          V	^,          ,          P                  4       /pV	^ ,          VR,          R&   V	^,          VR,          R&   VP                  V4       Kt  	  V# )aô  Returns data in Cytoscape JSON format (cyjs).

Parameters
----------
G : NetworkX Graph
    The graph to convert to cytoscape format
name : string
    A string which is mapped to the 'name' node element in cyjs format.
    Must not have the same value as `ident`.
ident : string
    A string which is mapped to the 'id' node element in cyjs format.
    Must not have the same value as `name`.

Returns
-------
data: dict
    A dictionary with cyjs formatted data.

Raises
------
NetworkXError
    If the values for `name` and `ident` are identical.

See Also
--------
cytoscape_graph: convert a dictionary in cyjs format to a graph

References
----------
.. [1] Cytoscape user's manual:
   http://manual.cytoscape.org/en/stable/index.html

Examples
--------
>>> from pprint import pprint
>>> G = nx.path_graph(2)
>>> cyto_data = nx.cytoscape_data(G)
>>> pprint(cyto_data, sort_dicts=False)
{'data': [],
 'directed': False,
 'multigraph': False,
 'elements': {'nodes': [{'data': {'id': '0', 'value': 0, 'name': '0'}},
                        {'data': {'id': '1', 'value': 1, 'name': '1'}}],
              'edges': [{'data': {'source': 0, 'target': 1}}]}}

The :mod:`json` package can be used to serialize the resulting data

>>> import io, json
>>> with io.StringIO() as fh:  # replace io with `open(...)` to write to disk
...     json.dump(cyto_data, fh)
...     fh.seek(0)  # doctest: +SKIP
...     print(fh.getvalue()[:64])  # View the first 64 characters
{"data": [], "directed": false, "multigraph": false, "elements":

ú!name and ident must be different.ÚdataÚdirectedÚ
multigraphÚnodesÚedgesÚelementsÚidÚvalueÚnameT)ÚkeysÚsourceÚtargetÚkey)ÚnxÚNetworkXErrorÚlistÚgraphÚitemsÚis_directedÚis_multigraphr
   ÚcopyÚgetÚstrÚappendr   Úadj)
ÚGr   ÚidentÚjsondatar
   r   ÚiÚjÚnÚes
   &&&       Úh/home/luca/screen-checking/.venv/lib/python3.14/site-packages/networkx/readwrite/json_graph/cytoscape.pyr   r      s  € ðp „}Ü×ÒÐBÓCÐCàœ˜QŸW™WŸ]™]›_Ó-Ð.€HØŸ=™=›?€HˆZÑØŸ_™_Ó.€Hˆ\ÑØ# R¨°"Ð5€HˆZÑØ�ZÕ  Õ)€EØ�ZÕ  Õ)€Eà—‘—‘–‰ˆØ�Q—V‘V“XÐˆØŸ%™% ›,×0Ð0¬#¨a«&ˆˆ&�	�$‰Øˆ&�	�'ÑØŸE™E $›K×1Ð1¬3¨q«6ˆˆ&�	�&ÑØ�‰�QŽñ  ð 	‡�×ÒØ—‘˜d�Ö#ˆAØ˜Ÿ™˜q �t� Q q¥TÕ*¨1¨Q­4Õ0×5Ñ5Ó7Ð8ˆAØ"# A¥$ˆAˆf�I�hÑØ"# A¥$ˆAˆf�I�hÑØ  �tˆAˆf�I�eÑØ�L‰L˜ŽOñ $ð €Oð —‘–ˆAØ˜Ÿ™˜q �t� Q q¥TÕ*×/Ñ/Ó1Ð2ˆAØ"# A¥$ˆAˆf�I�hÑØ"# A¥$ˆAˆf�I�hÑØ�L‰L˜ŽOñ	 ð
 €Oó    T)ÚgraphsÚreturns_graphc                óÐ  € W8X  d   \         P                  ! R4      hV P                  R4      pV P                  R4      pV'       d   \         P                  ! 4       pM\         P                  ! 4       pV'       d   VP                  4       p\        V P                  R4      4      Vn        V R,          R,           FÍ  pVR,          P                  4       pVR,          R,          pVR,          P                  V4      '       d   VR,          P                  V4      Wq&   VR,          P                  V4      '       d   VR,          P                  V4      Wr&   VP                  V4       VP                  V,          P                  V4       KÏ  	  V R,          R,           FÈ  pVR,          P                  4       p	VR,          R	,          p
VR,          R
,          pV'       dS   VR,          P                  R^ 4      pVP                  W«VR7       VP                  W«V3,          P                  V	4       K”  VP                  W«4       VP                  W«3,          P                  V	4       KÊ  	  V# )aÄ  
Create a NetworkX graph from a dictionary in cytoscape JSON format.

Parameters
----------
data : dict
    A dictionary of data conforming to cytoscape JSON format.
name : string
    A string which is mapped to the 'name' node element in cyjs format.
    Must not have the same value as `ident`.
ident : string
    A string which is mapped to the 'id' node element in cyjs format.
    Must not have the same value as `name`.

Returns
-------
graph : a NetworkX graph instance
    The `graph` can be an instance of `Graph`, `DiGraph`, `MultiGraph`, or
    `MultiDiGraph` depending on the input data.

Raises
------
NetworkXError
    If the `name` and `ident` attributes are identical.

See Also
--------
cytoscape_data: convert a NetworkX graph to a dict in cyjs format

References
----------
.. [1] Cytoscape user's manual:
   http://manual.cytoscape.org/en/stable/index.html

Examples
--------
>>> data_dict = {
...     "data": [],
...     "directed": False,
...     "multigraph": False,
...     "elements": {
...         "nodes": [
...             {"data": {"id": "0", "value": 0, "name": "0"}},
...             {"data": {"id": "1", "value": 1, "name": "1"}},
...         ],
...         "edges": [{"data": {"source": 0, "target": 1}}],
...     },
... }
>>> G = nx.cytoscape_graph(data_dict)
>>> G.name
''
>>> G.nodes()
NodeView((0, 1))
>>> G.nodes(data=True)[0]
{'id': '0', 'value': 0, 'name': '0'}
>>> G.edges(data=True)
EdgeDataView([(0, 1, {'source': 0, 'target': 1})])
r   r	   r   r   r   r
   r   r   r   r   r   )r   )r   r   r   Ú
MultiGraphÚGraphÚto_directedÚdictr   r   Úadd_noder
   ÚupdateÚadd_edger   )r   r   r!   r	   r   r   ÚdÚ	node_dataÚnodeÚ	edge_dataÚsourÚtargr   s   &&&          r'   r   r   _   sÑ  € ðx „}Ü×ÒÐBÓCÐCà—‘˜,Ó'€JØ�x‰x˜
Ó#€HßÜ—’“‰ä—’“
ˆßØ×!Ñ!Ó#ˆÜ�t—x‘x Ó'Ó(€E„KØ�*Õ˜g×&Ð&ˆØ�f•I—N‘NÓ$ˆ	Ø��y˜Õ!ˆàˆV�9�=‰=˜×ÒØ �iŸm™m¨DÓ1ˆI‰OØˆV�9�=‰=˜×ÒØ  �yŸ}™}¨UÓ3ˆIÑà�‰�tÔØ�‰�DÕ× Ñ  Ö+ñ 'ð �*Õ˜g×&Ð&ˆØ�f•I—N‘NÓ$ˆ	Ø��y˜Õ"ˆØ��y˜Õ"ˆßØ�F•)—-‘-  qÓ)ˆCØ�N‰N˜4¨3ˆNÔ/Ø�K‰K˜ C˜Õ(×/Ñ/°	Ö:à�N‰N˜4Ô&Ø�K‰K˜˜
Õ#×*Ñ*¨9Ö5ñ 'ð €Lr(   )r   r   )Únetworkxr   Ú__all__r   Ú_dispatchabler   © r(   r'   Ú<module>r=      s=   ðÛ àÐ.Ð
/€ôVðr ×Ò˜¨TÔ2ó^ó 3ò^r(   