Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Changes in 0.5.1
# Changes in 0.6.0

## Breaking changes

Expand All @@ -20,6 +20,7 @@
- fixed a bug in `from_neo4j`, where the node size would always be set to the `size` property.
- fixed a bug in `from_neo4j`, where the node caption would always be set to the `caption` property.
- Color nodes in `from_snowflake` only if there are less than 13 node tables used. This avoids reuse of colors for different tables.
- fixed a bug in `from_gds`, where properties of type list could not be imported.

## Improvements

Expand Down
16 changes: 14 additions & 2 deletions docs/source/customizing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,28 @@ Direct modification of nodes and relationships

Nodes and relationships can also be modified directly by accessing the ``nodes`` and ``relationships`` fields of an
existing ``VisualizationGraph`` object.
These attributes list of all the :doc:`Nodes <./api-reference/node>` and
These fields list of all the :doc:`Nodes <./api-reference/node>` and
:doc:`Relationships <./api-reference/relationship>` in the graph, respectively.

Each node and relationship has attributes that can be accessed and modified directly, as in the following example:
Each node and relationship has fields that can be accessed and modified directly, as in the following example:

.. code-block:: python

# VG is a VisualizationGraph object

# Modify the first node and fifth relationship
VG.nodes[0].size = 10
VG.nodes[0].properties["height"] = 170
VG.relationships[4].caption = "BUYS"

# Set the coordinates for all nodes from an existing property
for node in VG.nodes:
node.x = node.properties.get("x")
node.y = node.properties.get("y")

# Change the caption size for all relationships
for relationship in VG.relationships:
relationship.caption_size = 15


Any changes made to the nodes and relationships will be reflected in the next rendering of the graph.
181 changes: 99 additions & 82 deletions examples/gds-example.ipynb

Large diffs are not rendered by default.

48 changes: 24 additions & 24 deletions examples/neo4j-example.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion python-wrapper/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "neo4j-viz"
version = "0.5.1"
version = "0.6.0"
description = "A simple graph visualization tool"
readme = "README.md"
authors = [{ name = "Neo4j", email = "[email protected]" }]
Expand Down
2 changes: 1 addition & 1 deletion python-wrapper/src/neo4j_viz/gds.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def from_gds(
if property_name is not None and property_name in df.columns:
df.drop(columns=[property_name], inplace=True)

node_props_df = pd.concat(node_dfs.values(), ignore_index=True, axis=0).drop_duplicates()
node_props_df = pd.concat(node_dfs.values(), ignore_index=True, axis=0).drop_duplicates(subset=["nodeId"])

for lbl, df in node_dfs.items():
if "labels" in all_actual_node_properties:
Expand Down