neo4j-viz 0.4.2__tar.gz → 0.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/PKG-INFO +5 -3
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/pyproject.toml +4 -3
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/src/neo4j_viz/gds.py +10 -9
- neo4j_viz-0.5.0/src/neo4j_viz/resources/nvl_entrypoint/base.js +2 -0
- neo4j_viz-0.5.0/src/neo4j_viz/snowflake.py +344 -0
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/src/neo4j_viz/visualization_graph.py +2 -1
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/src/neo4j_viz.egg-info/PKG-INFO +5 -3
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/src/neo4j_viz.egg-info/SOURCES.txt +3 -1
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/src/neo4j_viz.egg-info/requires.txt +5 -2
- neo4j_viz-0.5.0/tests/test_snowflake.py +77 -0
- neo4j_viz-0.4.2/src/neo4j_viz/resources/nvl_entrypoint/base.js +0 -2
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/README.md +0 -0
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/setup.cfg +0 -0
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/src/neo4j_viz/__init__.py +0 -0
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/src/neo4j_viz/colors.py +0 -0
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/src/neo4j_viz/gql_create.py +0 -0
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/src/neo4j_viz/neo4j.py +0 -0
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/src/neo4j_viz/node.py +0 -0
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/src/neo4j_viz/node_size.py +0 -0
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/src/neo4j_viz/nvl.py +0 -0
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/src/neo4j_viz/options.py +0 -0
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/src/neo4j_viz/pandas.py +0 -0
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/src/neo4j_viz/py.typed +0 -0
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/src/neo4j_viz/relationship.py +0 -0
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/src/neo4j_viz/resources/icons/screenshot.svg +0 -0
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/src/neo4j_viz/resources/icons/zoom-in.svg +0 -0
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/src/neo4j_viz/resources/icons/zoom-out.svg +0 -0
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/src/neo4j_viz/resources/nvl_entrypoint/styles.css +0 -0
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/src/neo4j_viz.egg-info/dependency_links.txt +0 -0
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/src/neo4j_viz.egg-info/top_level.txt +0 -0
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/tests/test_colors.py +0 -0
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/tests/test_gds.py +0 -0
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/tests/test_gql_create.py +0 -0
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/tests/test_neo4j.py +0 -0
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/tests/test_node.py +0 -0
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/tests/test_notebooks.py +0 -0
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/tests/test_options.py +0 -0
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/tests/test_pandas.py +0 -0
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/tests/test_pinned.py +0 -0
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/tests/test_relationship.py +0 -0
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/tests/test_render.py +0 -0
- {neo4j_viz-0.4.2 → neo4j_viz-0.5.0}/tests/test_sizes.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: neo4j-viz
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.5.0
|
|
4
4
|
Summary: A simple graph visualization tool
|
|
5
5
|
Author-email: Neo4j <team-gds@neo4j.org>
|
|
6
6
|
Project-URL: Homepage, https://neo4j.com/
|
|
@@ -34,7 +34,7 @@ Requires-Dist: pydantic-extra-types<3,>=2
|
|
|
34
34
|
Requires-Dist: enum-tools==0.12.0
|
|
35
35
|
Provides-Extra: dev
|
|
36
36
|
Requires-Dist: ruff==0.11.8; extra == "dev"
|
|
37
|
-
Requires-Dist: mypy==1.
|
|
37
|
+
Requires-Dist: mypy==1.17.1; extra == "dev"
|
|
38
38
|
Requires-Dist: pytest==8.3.4; extra == "dev"
|
|
39
39
|
Requires-Dist: selenium==4.32.0; extra == "dev"
|
|
40
40
|
Requires-Dist: ipykernel==6.29.5; extra == "dev"
|
|
@@ -55,6 +55,8 @@ Provides-Extra: gds
|
|
|
55
55
|
Requires-Dist: graphdatascience<2,>=1; extra == "gds"
|
|
56
56
|
Provides-Extra: neo4j
|
|
57
57
|
Requires-Dist: neo4j; extra == "neo4j"
|
|
58
|
+
Provides-Extra: snowflake
|
|
59
|
+
Requires-Dist: snowflake-snowpark-python<2,>=1; extra == "snowflake"
|
|
58
60
|
Provides-Extra: notebook
|
|
59
61
|
Requires-Dist: ipykernel>=6.29.5; extra == "notebook"
|
|
60
62
|
Requires-Dist: pykernel>=0.1.6; extra == "notebook"
|
|
@@ -62,7 +64,7 @@ Requires-Dist: neo4j>=5.26.0; extra == "notebook"
|
|
|
62
64
|
Requires-Dist: ipywidgets>=8.0.0; extra == "notebook"
|
|
63
65
|
Requires-Dist: palettable>=3.3.3; extra == "notebook"
|
|
64
66
|
Requires-Dist: matplotlib>=3.9.4; extra == "notebook"
|
|
65
|
-
Requires-Dist: snowflake-snowpark-python==1.
|
|
67
|
+
Requires-Dist: snowflake-snowpark-python==1.37.0; extra == "notebook"
|
|
66
68
|
|
|
67
69
|
# Graph Visualization for Python by Neo4j
|
|
68
70
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "neo4j-viz"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.5.0"
|
|
8
8
|
description = "A simple graph visualization tool"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [{ name = "Neo4j", email = "team-gds@neo4j.org" }]
|
|
@@ -42,7 +42,7 @@ requires-python = ">=3.9"
|
|
|
42
42
|
[project.optional-dependencies]
|
|
43
43
|
dev = [
|
|
44
44
|
"ruff==0.11.8",
|
|
45
|
-
"mypy==1.
|
|
45
|
+
"mypy==1.17.1",
|
|
46
46
|
"pytest==8.3.4",
|
|
47
47
|
"selenium==4.32.0",
|
|
48
48
|
"ipykernel==6.29.5",
|
|
@@ -61,6 +61,7 @@ docs = [
|
|
|
61
61
|
pandas = ["pandas>=2, <3", "pandas-stubs>=2, <3"]
|
|
62
62
|
gds = ["graphdatascience>=1, <2"]
|
|
63
63
|
neo4j = ["neo4j"]
|
|
64
|
+
snowflake = ["snowflake-snowpark-python>=1, <2"]
|
|
64
65
|
notebook = [
|
|
65
66
|
"ipykernel>=6.29.5",
|
|
66
67
|
"pykernel>=0.1.6",
|
|
@@ -68,7 +69,7 @@ notebook = [
|
|
|
68
69
|
"ipywidgets>=8.0.0",
|
|
69
70
|
"palettable>=3.3.3",
|
|
70
71
|
"matplotlib>=3.9.4",
|
|
71
|
-
"snowflake-snowpark-python==1.
|
|
72
|
+
"snowflake-snowpark-python==1.37.0",
|
|
72
73
|
]
|
|
73
74
|
|
|
74
75
|
[project.urls]
|
|
@@ -2,7 +2,7 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import warnings
|
|
4
4
|
from itertools import chain
|
|
5
|
-
from typing import Optional
|
|
5
|
+
from typing import Optional, cast
|
|
6
6
|
from uuid import uuid4
|
|
7
7
|
|
|
8
8
|
import pandas as pd
|
|
@@ -81,31 +81,32 @@ def from_gds(
|
|
|
81
81
|
"""
|
|
82
82
|
node_properties_from_gds = G.node_properties()
|
|
83
83
|
assert isinstance(node_properties_from_gds, pd.Series)
|
|
84
|
-
actual_node_properties = node_properties_from_gds.to_dict()
|
|
84
|
+
actual_node_properties: dict[str, list[str]] = cast(dict[str, list[str]], node_properties_from_gds.to_dict())
|
|
85
85
|
all_actual_node_properties = list(chain.from_iterable(actual_node_properties.values()))
|
|
86
86
|
|
|
87
87
|
if size_property is not None:
|
|
88
88
|
if size_property not in all_actual_node_properties:
|
|
89
89
|
raise ValueError(f"There is no node property '{size_property}' in graph '{G.name()}'")
|
|
90
90
|
|
|
91
|
+
node_properties_by_label_sets: dict[str, set[str]] = dict()
|
|
91
92
|
if additional_node_properties is None:
|
|
92
|
-
|
|
93
|
+
node_properties_by_label_sets = {k: set(v) for k, v in actual_node_properties.items()}
|
|
93
94
|
else:
|
|
94
95
|
for prop in additional_node_properties:
|
|
95
96
|
if prop not in all_actual_node_properties:
|
|
96
97
|
raise ValueError(f"There is no node property '{prop}' in graph '{G.name()}'")
|
|
97
98
|
|
|
98
|
-
node_properties_by_label = {}
|
|
99
99
|
for label, props in actual_node_properties.items():
|
|
100
|
-
|
|
100
|
+
node_properties_by_label_sets[label] = {
|
|
101
101
|
prop for prop in actual_node_properties[label] if prop in additional_node_properties
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
if size_property is not None:
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
# For some reason mypy are unable to understand that this is dict[str, set[str]]
|
|
106
|
+
for label, props in node_properties_by_label_sets.items(): # type: ignore
|
|
107
|
+
props.add(size_property) # type: ignore
|
|
107
108
|
|
|
108
|
-
node_properties_by_label = {k: list(v) for k, v in
|
|
109
|
+
node_properties_by_label = {k: list(v) for k, v in node_properties_by_label_sets.items()}
|
|
109
110
|
|
|
110
111
|
node_count = G.node_count()
|
|
111
112
|
if node_count > max_node_count:
|
|
@@ -148,7 +149,7 @@ def from_gds(
|
|
|
148
149
|
if size_property is not None:
|
|
149
150
|
if "size" in all_actual_node_properties and size_property != "size":
|
|
150
151
|
node_props_df.rename(columns={"size": "__size"}, inplace=True)
|
|
151
|
-
if size_property not in additional_node_properties:
|
|
152
|
+
if additional_node_properties is not None and size_property not in additional_node_properties:
|
|
152
153
|
node_props_df.rename(columns={size_property: "size"}, inplace=True)
|
|
153
154
|
else:
|
|
154
155
|
node_props_df["size"] = node_props_df[size_property]
|