Skip to main content

This is a simple encapsulation for networkX, which further simplifies the process of networkX for drawing neural network diagrams, so that the author can only focus on the logical writing of neural networks, without spending time on the visual presentation of neural networks. At the same time, this module also inherits all the methods of network and does not affect the normal function calls of networkX.

Project description

networkXsimple

This is a simple encapsulation for networkX, which further simplifies the process of networkX for drawing neural network diagrams, so that the author can only focus on the logical writing of neural networks, without spending time on the visual presentation of neural networks. At the same time, this module also inherits all the methods of network and does not affect the normal function calls of networkX.

install

pip install NetworkXsimple

guid

api

graph.addNode(
    name="node name",
    pos=(int layer, int node No)  ,
    nexts=[
    {
        "node": "G",
        "label":"edge label"
    }],
    previous=[
        {
            "node": "G",
            "label": "edge label G"
        }
    ],
    label="AAAAA",
    label_color="pink")

img.png

  • nexts : output degress dict
  • previous : input degress dict { "node": "next node name", "label":"edge desc" }

exmaple

from package_xskj_NetworkXsimple import netGraph

from net import netGraph

# 示例用法
graph = netGraph(type=1)

# 添加节点
graph.addNode(
    name="A",
    pos=(1, 1),
    nexts=[
        {
            "node": "G",
            "label": "edge label"
        }],
    previous=[
        {
            "node": "G",
            "label": "edge label G"
        }
    ],
    label="AAAAA",
    label_color="pink")

graph.addNode(name="B", label="BBBBB", pos=(1, 2))
graph.addNode(name="C", label="BBBBB", pos=(1, 3))
graph.addNode(name="D", label="节点A", pos=(1, 4))
graph.addNode(name="E", label="节点A", pos=(1, 5))
graph.addNode(name="F", label="节点A", pos=(1, 6))
graph.addNode(name="I", label="节点A", pos=(1, 7))
graph.addNode(name="G", label="节点B", pos=(2, 1))
# graph.addNode(name="H", desc="节点B", pos=(2, 2))
# graph.addNode(name="Z", desc="节点B", pos=(2, 3))

graph.addNode(name="1", label="节点B", pos=(3, 1))
# graph.addNode(name="2", desc="节点B", pos=(3, 2))
# graph.addNode(name="3", desc="节点B", pos=(3, 3))

# 增加边
graph.addEdge(("B", "G"))
# 绘制网络图
graph.draw()

show

img_2.png

update log

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

NetworkXsimple-0.2.0.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

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

NetworkXsimple-0.2.0-py2.py3-none-any.whl (10.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file NetworkXsimple-0.2.0.tar.gz.

File metadata

  • Download URL: NetworkXsimple-0.2.0.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.8

File hashes

Hashes for NetworkXsimple-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3c30ba9f42125412d9c7c166dec7f7c1262c0a90885bcc63f142e3c7131484a4
MD5 165b3641622b44bc42ec0fd95a047501
BLAKE2b-256 8f73e6ffaf344bd5570aa225d59a59f8a080418ed85d70ee6a055205608ed969

See more details on using hashes here.

File details

Details for the file NetworkXsimple-0.2.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for NetworkXsimple-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 746d4ca9fb5766a3fc145ed4e45fb07545492225626f0a06ff1f7031fbcdbbe8
MD5 bd4b20073866a3b668f72117c96ed401
BLAKE2b-256 6be73b4752e50a900529bc585076f34a2632de69b5bc0c6de7e62b5259952d8a

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