Skip to content

Commit 5c940a4

Browse files
authored
Merge pull request #244 from neo4j/docs-setting-fields
Prepare for 0.6.0 release
2 parents c26814d + 744d9a7 commit 5c940a4

File tree

6 files changed

+141
-111
lines changed

6 files changed

+141
-111
lines changed

changelog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Changes in 0.5.1
1+
# Changes in 0.6.0
22

33
## Breaking changes
44

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

2425
## Improvements
2526

docs/source/customizing.rst

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,16 +182,28 @@ Direct modification of nodes and relationships
182182

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

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

190190
.. code-block:: python
191191
192192
# VG is a VisualizationGraph object
193+
194+
# Modify the first node and fifth relationship
193195
VG.nodes[0].size = 10
194196
VG.nodes[0].properties["height"] = 170
195197
VG.relationships[4].caption = "BUYS"
196198
199+
# Set the coordinates for all nodes from an existing property
200+
for node in VG.nodes:
201+
node.x = node.properties.get("x")
202+
node.y = node.properties.get("y")
203+
204+
# Change the caption size for all relationships
205+
for relationship in VG.relationships:
206+
relationship.caption_size = 15
207+
208+
197209
Any changes made to the nodes and relationships will be reflected in the next rendering of the graph.

examples/gds-example.ipynb

Lines changed: 99 additions & 82 deletions
Large diffs are not rendered by default.

examples/neo4j-example.ipynb

Lines changed: 24 additions & 24 deletions
Large diffs are not rendered by default.

python-wrapper/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "neo4j-viz"
7-
version = "0.5.1"
7+
version = "0.6.0"
88
description = "A simple graph visualization tool"
99
readme = "README.md"
1010
authors = [{ name = "Neo4j", email = "[email protected]" }]

python-wrapper/src/neo4j_viz/gds.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def from_gds(
151151
if property_name is not None and property_name in df.columns:
152152
df.drop(columns=[property_name], inplace=True)
153153

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

156156
for lbl, df in node_dfs.items():
157157
if "labels" in all_actual_node_properties:

0 commit comments

Comments
 (0)