Skip to main content

Python library for easily interacting with trained machine learning models

Project description


tags: [gradio-custom-component, ] title: gradio_networkgraph short_description: A gradio custom component colorFrom: blue colorTo: yellow sdk: gradio pinned: false app_file: space.py

gradio_networkgraph

Static Badge

Python library for easily interacting with trained machine learning models

Installation

pip install gradio_networkgraph

Usage

import gradio as gr
from gradio_networkgraph import NetworkGraph


def on_graph_interaction(graph, event_data: gr.EventData):
    return event_data._data


with gr.Blocks() as demo:
    graph = NetworkGraph(
        value={
            "nodes": [{'id': 1, "label": "node 1"}, {'id': 2, "label": "node 2"}],
            "edges": [{"from": 1, "to": 2, "label": "edge", "id": "edge1"}],
            "options": {}
        },
        label="Static"
    )
    output = gr.Textbox()
    graph.selectNode(on_graph_interaction, inputs=[graph], outputs=[output])
    graph.deselectNode(on_graph_interaction, inputs=[graph], outputs=[output])
    graph.selectEdge(on_graph_interaction, inputs=[graph], outputs=[output])
    graph.deselectEdge(on_graph_interaction, inputs=[graph], outputs=[output])


if __name__ == "__main__":
    demo.launch()

NetworkGraph

Initialization

name type default description
value
Any
None None
label
str | None
None None
info
str | None
None None
show_label
bool | None
None None
container
bool
True None
scale
int | None
None None
min_width
int | None
None None
interactive
bool | None
None None
visible
bool
True None
elem_id
str | None
None None
elem_classes
list[str] | str | None
None None
render
bool
True None
key
int | str | None
None None
load_fn
Callable | None
None None
every
Timer | float | None
None None
inputs
Component | Sequence[Component] | set[Component] | None
None None

Events

name description
selectNode
deselectNode
selectEdge
deselectEdge

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

gradio_networkgraph-0.0.1.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gradio_networkgraph-0.0.1-py3-none-any.whl (1.3 MB view details)

Uploaded Python 3

File details

Details for the file gradio_networkgraph-0.0.1.tar.gz.

File metadata

  • Download URL: gradio_networkgraph-0.0.1.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.1

File hashes

Hashes for gradio_networkgraph-0.0.1.tar.gz
Algorithm Hash digest
SHA256 9ce9df0a4eb6eabbcbfff8cca5ea2b1ee9fdc6284a1f81df6113e664d9a34915
MD5 cad2d2e2724788b62f04f1e321fdfdab
BLAKE2b-256 baebf5603237df445a759245c5eeacafb3da60fafce5571aaf243b21b3893c97

See more details on using hashes here.

File details

Details for the file gradio_networkgraph-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for gradio_networkgraph-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 11dc7dd5d66caf39d085badbe9c458481526ea0d9215f110d8459d033893883b
MD5 d4d7a47502f5be06f5cb540137b92616
BLAKE2b-256 8ade73b52032dceadb1e9490a860c012d69bae40540d7779b20ed43fbe3ccdd9

See more details on using hashes here.

Supported by

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