Skip to main content

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)

  1. Select whether you want to edit graph structure.
  2. Select whether you want to edit labels.
  3. Toggle nodes clickable option.
  4. Toggle edges clickable option.
  5. Close editing window.

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.
    An edge will be created between the two selected vertices.
  3. To create a vertex, click on empty space of a 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.

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

graph_editor-0.0.2.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

graph_editor-0.0.2-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file graph_editor-0.0.2.tar.gz.

File metadata

  • Download URL: graph_editor-0.0.2.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for graph_editor-0.0.2.tar.gz
Algorithm Hash digest
SHA256 8007ff788f080937d3b7d2e0819cde3df58ed003c0578b391a1125556922cffd
MD5 93ae9541f430746b62e837a46cbefd6e
BLAKE2b-256 66cde12aaa3f322199a2d085249504b6da9b0b856abdeabfc6043048b85e9c68

See more details on using hashes here.

File details

Details for the file graph_editor-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: graph_editor-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for graph_editor-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d37cd4614e00e56a0c4a2870ad2c8d87179a2bec7db4e785f4b137c553d85f06
MD5 0c64bebd78123cb74d553f8793885e7e
BLAKE2b-256 d29aa2532301fd11ba52d41df920bdc562d67f5f210a4fa2bcedfb69c48e6873

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page