Graph editor for Jupyter
Project description
Interactive Graph Editor for Jupyter
An interactive graph editor function designed for Jupyter notebooks. edit(graph: nx.Graph) function allows users
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.
Functions of buttons (from left to right)
- Select whether you want to edit graph structure.
- Select whether you want to edit labels.
- Toggle nodes clickable option.
- Toggle edges clickable option.
- Close editing window.
Mouse Functions
- Click and drag vertices to move them around the canvas.
- To create an edge, click on one vertex and then click on another vertex.
An edge will be created between the two selected vertices. - To create a vertex, click on empty space of a canvas.
- 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.
Examples
import networkx as nx
# 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)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pygraphedit-0.0.3.tar.gz.
File metadata
- Download URL: pygraphedit-0.0.3.tar.gz
- Upload date:
- Size: 11.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db9a1b3595623493f132a590f69d2d5c46365b637df07c79b5cef28a66f9d4b8
|
|
| MD5 |
9a57775ff634e260298875141ee7895b
|
|
| BLAKE2b-256 |
c4ac181402dd7680a19e5550b9992b6b7a7d952c62d478c871ac8028b6108f0c
|
File details
Details for the file pygraphedit-0.0.3-py3-none-any.whl.
File metadata
- Download URL: pygraphedit-0.0.3-py3-none-any.whl
- Upload date:
- Size: 12.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77029697ad2146093066fb9061919ec1283cb53bf6a1077261c74cdba3dbe511
|
|
| MD5 |
7b21500dd04ad15d82923d949d2ebe0f
|
|
| BLAKE2b-256 |
0b40c530135dd773c37f3ceaa39b493037ac99ee3fa34a9c9396f9dabcdf8c85
|