Metadata-Version: 2.2
Name: graph-editor-jupyter
Version: 0.0.5
Summary: Graph editor for Jupyter
Author: Andrii Kovryhin, Maksym Tur, Denis Logunov, Izabella Tylek, Andrzej Kwaśniewski, Augustyn Majtyka, Roman Gicała, Rafał Przypek
Project-URL: Homepage, https://github.com/Student-Team-Projects/Graph-Editor-Jupyter
Project-URL: Issues, https://github.com/Student-Team-Projects/Graph-Editor-Jupyter/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: asttokens==2.4.1
Requires-Dist: colorama==0.4.6
Requires-Dist: comm==0.2.0
Requires-Dist: decorator==5.1.1
Requires-Dist: executing==2.0.1
Requires-Dist: ipycanvas==0.13.1
Requires-Dist: ipyevents==2.0.2
Requires-Dist: ipython==8.18.1
Requires-Dist: ipywidgets==8.1.1
Requires-Dist: jedi==0.19.1
Requires-Dist: jupyterlab-widgets==3.0.9
Requires-Dist: matplotlib-inline==0.1.6
Requires-Dist: networkx==3.2.1
Requires-Dist: numpy==1.26.2
Requires-Dist: parso==0.8.3
Requires-Dist: Pillow==10.1.0
Requires-Dist: prompt-toolkit==3.0.41
Requires-Dist: pure-eval==0.2.2
Requires-Dist: Pygments==2.17.2
Requires-Dist: scipy==1.11.4
Requires-Dist: six==1.16.0
Requires-Dist: stack-data==0.6.3
Requires-Dist: traitlets==5.14.0
Requires-Dist: wcwidth==0.2.12
Requires-Dist: widgetsnbextension==4.0.9
Requires-Dist: pymunk==6.6.0

## Interactive Graph Editor for Jupyter

An interactive graph editor function designed for Jupyter notebooks. ```edit(graph: nx.Graph)``` function allows users <br>
to manipulate a graph by creating vertices, edges, and adding labels directly within a Jupyter environment.

### Parameters
- **graph** (*networkx.Graph*): The graph object to be edited.
  It should be an instance of the NetworkX Graph class or a subclass.
- **color_dict** (*Dict[str, str]*): Map of color labels into HTML colors,
  empty by default.

### Functions of buttons (from left to right)
1. Select if you want to edit graph structure.
2. Select if you want to edit labels.
3. Select if you want for nodes to be clickable.
    Deselecting this should make it easier to operate on edges in a large graph.
4. Select if you want for edges to be clickable.
    Deselecting this should make it easier to operate on nodes in a large graph.
5. Turn on/off physics.
6. Turn on/off fancy drawing (planar representation of a graph, works only for 3-connected planar graphs).
7. Enable/disable labels.
8. Exit the editor.

### Mouse Functions
1. Click and drag vertices to move them around the canvas.
2. To create an edge, click on one vertex and then click on another vertex.<br>
An edge will be created between the two selected vertices.
3. To create a vertex, click on empty space on the canvas.
4. To delete an object, double-click on it.

### Dependencies
- Jupyter notebook web environment.
- NetworkX library for graph manipulation.

### Notes
This function relies on Jupyter ipywidgets, so it should work only in web versions of Jupyter.
 (It is possible to run editor in VSCode but it is not guaranteed that it will work properly or even run at all.)

### Installation instructions
go to: https://pypi.org/project/graph-editor-jupyter/ <br>
or run:
> pip install graph-editor-jupyter

### Examples
```python
import networkx as nx
from graph_editor_jupyter import edit

# Create a sample graph
G = nx.Graph()
G.add_nodes_from([1, 2, 3])
G.add_edges_from([(1, 2), (2, 3)])

# Call the interactive graph editor
edit(G)
