Skip to content

Commit d37119f

Browse files
committed
Fix examples
1 parent 081087d commit d37119f

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

python-wrapper/src/neo4j_viz/gds.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,7 @@ def from_gds(
7070
* the caption of a relationship will be based on its `relationshipType` property.
7171
* the color of nodes will be set based on their label, unless there are more than 12 unique labels.
7272
73-
All `node_properties` will be included in the visualization graph under the `properties` field.
74-
Otherwise, they will be included in the `properties` dictionary.
73+
All `node_properties` and `db_node_properties` will be included in the visualization graph under the `properties` field.
7574
Additionally, a new "labels" node property will be added, containing the node labels of the node.
7675
Similarly for relationships, a new "relationshipType" property will be added.
7776

python-wrapper/src/neo4j_viz/visualization_graph.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def __init__(self, nodes: list[Node], relationships: list[Relationship]) -> None
5656
... Node(id="2", properties={"name": "Bob", "age": 25}),
5757
... ]
5858
>>> relationships = [
59-
... Relationship(id="r1", start_node_id="1", end_node_id="2", type="KNOWS")
59+
... Relationship(id="r1", source="1", target="2", properties={"type": "KNOWS"})
6060
... ]
6161
>>> VG = VisualizationGraph(nodes=nodes, relationships=relationships)
6262
@@ -68,9 +68,9 @@ def __init__(self, nodes: list[Node], relationships: list[Relationship]) -> None
6868
6969
Setting a relationship field such as type from properties:
7070
71-
>>> # Set relationship type from property
71+
>>> # Set relationship caption from property
7272
>>> for rel in VG.relationships:
73-
... rel.type = rel.properties.get("type")
73+
... rel.caption = rel.properties.get("type")
7474
7575
Using built-in helper methods:
7676

0 commit comments

Comments
 (0)