neo4j-viz


Nameneo4j-viz JSON
Version 0.4.2 PyPI version JSON
download
home_pageNone
SummaryA simple graph visualization tool
upload_time2025-08-01 12:27:09
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseNone
keywords graph visualization neo4j
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Graph Visualization for Python by Neo4j

[![Latest version](https://img.shields.io/pypi/v/neo4j-viz)](https://pypi.org/project/neo4j-viz/)
[![PyPI downloads month](https://img.shields.io/pypi/dm/neo4j-viz)](https://pypi.org/project/neo4j-viz/)
![Python versions](https://img.shields.io/pypi/pyversions/neo4j-viz)
[![Documentation](https://img.shields.io/badge/Documentation-latest-blue)](https://neo4j.com/docs/nvl-python/preview/)
[![Discord](https://img.shields.io/discord/787399249741479977?label=Chat&logo=discord)](https://discord.gg/neo4j)
[![Community forum](https://img.shields.io/website?down_color=lightgrey&down_message=offline&label=Forums&logo=discourse&up_color=green&up_message=online&url=https%3A%2F%2Fcommunity.neo4j.com%2F)](https://community.neo4j.com)
[![License](https://img.shields.io/pypi/l/neo4j-viz)](https://pypi.org/project/neo4j-viz/)

`neo4j-viz` is a Python package for creating interactive graph visualizations.

The output is of type `IPython.display.HTML` and can be viewed directly in a Jupyter Notebook or Streamlit application.
Alternatively, you can export the output to a file and view it in a web browser.

The package wraps the [Neo4j Visualization JavaScript library (NVL)](https://neo4j.com/docs/nvl/current/).

> [!WARNING]
> This package is still in development and the API is subject to change.


![Example Graph](https://github.com/neo4j/python-graph-visualization/blob/main/examples/example_cora_graph.png)


## Some notable features

* Easy to import graphs represented as:
  * projections in the Neo4j Graph Data Science (GDS) library
  * graphs from Neo4j query results
  * pandas DataFrames
* Node features:
  * Sizing
  * Colors
  * Captions
  * Pinning
  * On hover tooltip
* Relationship features:
  * Colors
  * Captions
  * On hover tooltip
* Graph features:
  * Zooming
  * Panning
  * Moving nodes
  * Using different layouts
* Additional convenience functionality for:
  * Resizing nodes, optionally including scale normalization
  * Coloring nodes based on a property
  * Toggle whether nodes should be pinned or not

Please note that this list is by no means exhaustive.


## Getting started


### Installation

Simply install with pip:

```sh
pip install neo4j-viz
```


### Basic usage

We will use a small toy graph representing the purchase history of a few people and products.

We start by instantiating the [Nodes](https://neo4j.com/docs/nvl-python/preview/api-reference/node.html) and
[Relationships](https://neo4j.com/docs/nvl-python/preview/api-reference/relationship.html) we want in our graph.
The only mandatory fields for a node are the "id", and "source" and "target" for a relationship.
But the other fields can optionally be used to customize the appearance of the nodes and relationships in the
visualization.

Lastly we create a
[VisualizationGraph](https://neo4j.com/docs/nvl-python/preview/api-reference/visualization-graph.html) object with the
nodes and relationships we created, and call its `render` method to display the graph.

```python
from neo4j_viz import Node, Relationship, VisualizationGraph

nodes = [
    Node(id=0, size=10, caption="Person"),
    Node(id=1, size=10, caption="Product"),
    Node(id=2, size=20, caption="Product"),
    Node(id=3, size=10, caption="Person"),
    Node(id=4, size=10, caption="Product"),
]
relationships = [
    Relationship(
        source=0,
        target=1,
        caption="BUYS",
    ),
    Relationship(
        source=0,
        target=2,
        caption="BUYS",
    ),
    Relationship(
        source=3,
        target=2,
        caption="BUYS",
    ),
]

VG = VisualizationGraph(nodes=nodes, relationships=relationships)

VG.render()
```

This will return a `IPython.display.HTML` object that can be rendered in a Jupyter Notebook or streamlit application.

Please refer to the [documentation](https://neo4j.com/docs/nvl-python/preview/) for more details on the API and usage.


### Examples

For more extensive examples, including how to import graphs from Neo4j GDS projections and Pandas DataFrames,
checkout the [tutorials chapter](https://neo4j.com/docs/nvl-python/preview/tutorials/index.html) in the documentation.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "neo4j-viz",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "graph, visualization, neo4j",
    "author": null,
    "author_email": "Neo4j <team-gds@neo4j.org>",
    "download_url": "https://files.pythonhosted.org/packages/e4/3c/401ea0055c756555457d7caa34c23042eaea11407655f493ca15929af0f5/neo4j_viz-0.4.2.tar.gz",
    "platform": null,
    "description": "# Graph Visualization for Python by Neo4j\n\n[![Latest version](https://img.shields.io/pypi/v/neo4j-viz)](https://pypi.org/project/neo4j-viz/)\n[![PyPI downloads month](https://img.shields.io/pypi/dm/neo4j-viz)](https://pypi.org/project/neo4j-viz/)\n![Python versions](https://img.shields.io/pypi/pyversions/neo4j-viz)\n[![Documentation](https://img.shields.io/badge/Documentation-latest-blue)](https://neo4j.com/docs/nvl-python/preview/)\n[![Discord](https://img.shields.io/discord/787399249741479977?label=Chat&logo=discord)](https://discord.gg/neo4j)\n[![Community forum](https://img.shields.io/website?down_color=lightgrey&down_message=offline&label=Forums&logo=discourse&up_color=green&up_message=online&url=https%3A%2F%2Fcommunity.neo4j.com%2F)](https://community.neo4j.com)\n[![License](https://img.shields.io/pypi/l/neo4j-viz)](https://pypi.org/project/neo4j-viz/)\n\n`neo4j-viz` is a Python package for creating interactive graph visualizations.\n\nThe output is of type `IPython.display.HTML` and can be viewed directly in a Jupyter Notebook or Streamlit application.\nAlternatively, you can export the output to a file and view it in a web browser.\n\nThe package wraps the [Neo4j Visualization JavaScript library (NVL)](https://neo4j.com/docs/nvl/current/).\n\n> [!WARNING]\n> This package is still in development and the API is subject to change.\n\n\n![Example Graph](https://github.com/neo4j/python-graph-visualization/blob/main/examples/example_cora_graph.png)\n\n\n## Some notable features\n\n* Easy to import graphs represented as:\n  * projections in the Neo4j Graph Data Science (GDS) library\n  * graphs from Neo4j query results\n  * pandas DataFrames\n* Node features:\n  * Sizing\n  * Colors\n  * Captions\n  * Pinning\n  * On hover tooltip\n* Relationship features:\n  * Colors\n  * Captions\n  * On hover tooltip\n* Graph features:\n  * Zooming\n  * Panning\n  * Moving nodes\n  * Using different layouts\n* Additional convenience functionality for:\n  * Resizing nodes, optionally including scale normalization\n  * Coloring nodes based on a property\n  * Toggle whether nodes should be pinned or not\n\nPlease note that this list is by no means exhaustive.\n\n\n## Getting started\n\n\n### Installation\n\nSimply install with pip:\n\n```sh\npip install neo4j-viz\n```\n\n\n### Basic usage\n\nWe will use a small toy graph representing the purchase history of a few people and products.\n\nWe start by instantiating the [Nodes](https://neo4j.com/docs/nvl-python/preview/api-reference/node.html) and\n[Relationships](https://neo4j.com/docs/nvl-python/preview/api-reference/relationship.html) we want in our graph.\nThe only mandatory fields for a node are the \"id\", and \"source\" and \"target\" for a relationship.\nBut the other fields can optionally be used to customize the appearance of the nodes and relationships in the\nvisualization.\n\nLastly we create a\n[VisualizationGraph](https://neo4j.com/docs/nvl-python/preview/api-reference/visualization-graph.html) object with the\nnodes and relationships we created, and call its `render` method to display the graph.\n\n```python\nfrom neo4j_viz import Node, Relationship, VisualizationGraph\n\nnodes = [\n    Node(id=0, size=10, caption=\"Person\"),\n    Node(id=1, size=10, caption=\"Product\"),\n    Node(id=2, size=20, caption=\"Product\"),\n    Node(id=3, size=10, caption=\"Person\"),\n    Node(id=4, size=10, caption=\"Product\"),\n]\nrelationships = [\n    Relationship(\n        source=0,\n        target=1,\n        caption=\"BUYS\",\n    ),\n    Relationship(\n        source=0,\n        target=2,\n        caption=\"BUYS\",\n    ),\n    Relationship(\n        source=3,\n        target=2,\n        caption=\"BUYS\",\n    ),\n]\n\nVG = VisualizationGraph(nodes=nodes, relationships=relationships)\n\nVG.render()\n```\n\nThis will return a `IPython.display.HTML` object that can be rendered in a Jupyter Notebook or streamlit application.\n\nPlease refer to the [documentation](https://neo4j.com/docs/nvl-python/preview/) for more details on the API and usage.\n\n\n### Examples\n\nFor more extensive examples, including how to import graphs from Neo4j GDS projections and Pandas DataFrames,\ncheckout the [tutorials chapter](https://neo4j.com/docs/nvl-python/preview/tutorials/index.html) in the documentation.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A simple graph visualization tool",
    "version": "0.4.2",
    "project_urls": {
        "Documentation": "https://neo4j.com/docs/nvl-python/preview",
        "Homepage": "https://neo4j.com/",
        "Issues": "https://github.com/neo4j/python-graph-visualization/issues",
        "Repository": "https://github.com/neo4j/python-graph-visualization"
    },
    "split_keywords": [
        "graph",
        " visualization",
        " neo4j"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "24525ab60f7209c5b0ecbe6d301662c5dfbd66bd28873bb9641c00c69ca6021d",
                "md5": "f5ffa8c4b4b03259f529523e209ea8f2",
                "sha256": "b1185cfdca62359315bc9cee08d412972e9eef95b7b72a0dd2cd62c184533d6e"
            },
            "downloads": -1,
            "filename": "neo4j_viz-0.4.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f5ffa8c4b4b03259f529523e209ea8f2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 508127,
            "upload_time": "2025-08-01T12:27:08",
            "upload_time_iso_8601": "2025-08-01T12:27:08.109985Z",
            "url": "https://files.pythonhosted.org/packages/24/52/5ab60f7209c5b0ecbe6d301662c5dfbd66bd28873bb9641c00c69ca6021d/neo4j_viz-0.4.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "e43c401ea0055c756555457d7caa34c23042eaea11407655f493ca15929af0f5",
                "md5": "dbee7d0cf21b9f1f929ffc1e0c759975",
                "sha256": "d4bfcb10c9e01d8a3bf55178942a219cee6d1ad4490f7b7fc967b153fc329221"
            },
            "downloads": -1,
            "filename": "neo4j_viz-0.4.2.tar.gz",
            "has_sig": false,
            "md5_digest": "dbee7d0cf21b9f1f929ffc1e0c759975",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 514933,
            "upload_time": "2025-08-01T12:27:09",
            "upload_time_iso_8601": "2025-08-01T12:27:09.611068Z",
            "url": "https://files.pythonhosted.org/packages/e4/3c/401ea0055c756555457d7caa34c23042eaea11407655f493ca15929af0f5/neo4j_viz-0.4.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-01 12:27:09",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "neo4j",
    "github_project": "python-graph-visualization",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "neo4j-viz"
}
        
Elapsed time: 2.20788s