diff --git a/changelog.md b/changelog.md index 982d84a9..00538de1 100644 --- a/changelog.md +++ b/changelog.md @@ -1,4 +1,4 @@ -# Changes in 0.5.1 +# Changes in 0.6.0 ## Breaking changes @@ -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 diff --git a/docs/source/customizing.rst b/docs/source/customizing.rst index 0619658c..174875e4 100644 --- a/docs/source/customizing.rst +++ b/docs/source/customizing.rst @@ -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. diff --git a/examples/gds-example.ipynb b/examples/gds-example.ipynb index 17f7cffb..b8d907af 100644 --- a/examples/gds-example.ipynb +++ b/examples/gds-example.ipynb @@ -52,7 +52,7 @@ "metadata": {}, "outputs": [], "source": [ - "G = gds.graph.load_cora()" + "G = gds.graph.load_cora(graph_name=\"cora\")" ] }, { @@ -87,15 +87,13 @@ "VG = from_gds(\n", " gds,\n", " G,\n", - " size_property=\"pagerank\",\n", - " additional_node_properties=[\"componentId\", \"subject\"],\n", " max_node_count=100,\n", ")" ] }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 30, "metadata": { "tags": [ "preserve-output" @@ -162,27 +160,27 @@ "}\n", "\n", " \n", - "