You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: changelog.md
+11-2Lines changed: 11 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,20 +3,29 @@
3
3
## Breaking changes
4
4
5
5
- Do not automatically derive size and caption for `from_neo4j` and `from_gql_create`. Use the `size_property` and `node_caption` parameters to explicitly configure them.
6
+
- Change API of integrations to only provide basic parameters. Any further configuration should happen ons the Visualization Graph object:
7
+
-`from_gds`
8
+
- Drop parameters size_property, node_radius_min_max. `Use VG.resize_nodes(property=...)` instead
9
+
- rename additional_node_properties to node_properties
10
+
- Don't derive fields from properties. Use `VG.map_properties_to_fields` instead
11
+
-`from_pandas`
12
+
- Drop `node_radius_min_max` parameter. `VG.resize_nodes(...)` instead
6
13
7
14
## New features
8
15
9
-
- Allow to include db node properties in addition to the properties in the GDS Graph. Specify `additional_db_node_properties` in `from_gds`.
10
-
16
+
- Allow to include db node properties in addition to the properties in the GDS Graph. Specify `db_node_properties` in `from_gds`.
11
17
12
18
## Bug fixes
13
19
14
20
- fixed a bug in `from_neo4j`, where the node size would always be set to the `size` property.
15
21
- fixed a bug in `from_neo4j`, where the node caption would always be set to the `caption` property.
22
+
- Color nodes in `from_snowflake` only if there are less than 13 node tables used. This avoids reuse of colors for different tables.
16
23
17
24
## Improvements
18
25
19
26
- Validate fields of a node and relationship not only at construction but also on assignment.
20
27
- Allow resizing per node property such as `VG.resize_nodes(property="score")`.
28
+
- Color nodes by label in `from_gds`.
29
+
- Add `table` property to nodes and relationships created by `from_snowflake`. This is used as a default caption.
Copy file name to clipboardExpand all lines: docs/source/integration.rst
+10-32Lines changed: 10 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,28 +35,17 @@ The ``from_dfs`` method takes two mandatory positional parameters:
35
35
* A Pandas ``DataFrame``, or iterable (eg. list) of DataFrames representing the nodes of the graph.
36
36
The rows of the DataFrame(s) should represent the individual nodes, and the columns should represent the node
37
37
IDs and attributes.
38
-
If a column shares the name with a field of :doc:`Node <./api-reference/node>`, the values it contains will be set
39
-
on corresponding nodes under that field name.
40
-
Otherwise, the column name will be a key in each node's `properties` dictionary, that maps to the node's corresponding
38
+
The node ID will be set on the :doc:`Node <./api-reference/node>`,
39
+
Other columns will be a key in each node's `properties` dictionary, that maps to the node's corresponding
41
40
value in the column.
42
41
If the graph has no node properties, the nodes can be derived from the relationships DataFrame alone.
43
42
* A Pandas ``DataFrame``, or iterable (eg. list) of DataFrames representing the relationships of the graph.
44
43
The rows of the DataFrame(s) should represent the individual relationships, and the columns should represent the
45
44
relationship IDs and attributes.
46
-
If a column shares the name with a field of :doc:`Relationship <./api-reference/relationship>`, the values it contains
47
-
will be set on corresponding relationships under that field name.
48
-
Otherwise, the column name will be a key in each node's `properties` dictionary, that maps to the node's corresponding
45
+
The relationship id, source and target node IDs will be set on the :doc:`Relationship <./api-reference/relationship>`.
46
+
Other columns will be a key in each relationship's `properties` dictionary, that maps to the relationship's corresponding
49
47
value in the column.
50
48
51
-
``from_dfs`` also takes an optional property, ``node_radius_min_max``, that can be used (and is used by default) to
52
-
scale the node sizes for the visualization.
53
-
It is a tuple of two numbers, representing the radii (sizes) in pixels of the smallest and largest nodes respectively in
54
-
the visualization.
55
-
The node sizes will be scaled such that the smallest node will have the size of the first value, and the largest node
56
-
will have the size of the second value.
57
-
The other nodes will be scaled linearly between these two values according to their relative size.
58
-
This can be useful if node sizes vary a lot, or are all very small or very big.
59
-
60
49
61
50
Example
62
51
~~~~~~~
@@ -111,33 +100,21 @@ If you want to have more control of the sampling, such as choosing a specific st
111
100
a `sampling <https://neo4j.com/docs/graph-data-science/current/management-ops/graph-creation/sampling/>`_
112
101
method yourself and passing the resulting projection to ``from_gds``.
113
102
114
-
We can also provide an optional ``size_property`` parameter, which should refer to a node property of the projection,
115
-
and will be used to determine the sizes of the nodes in the visualization.
116
-
117
-
The ``additional_node_properties`` parameter is also optional, and should be a list of additional node properties of the
103
+
The ``node_properties`` parameter is also optional, and should be a list of additional node properties of the
118
104
projection that you want to include in the visualization.
119
105
The default is ``None``, which means that all properties of the nodes in the projection will be included.
120
106
Apart from being visible through on-hover tooltips, these properties could be used to color the nodes, or give captions
121
107
to them in the visualization, or simply included in the nodes' ``Node.properties`` maps without directly impacting the
122
108
visualization.
123
-
If you want to include node properties stored at the Neo4j database, you can include them in the visualization by using the `additional_db_node_properties` parameter.
124
-
125
-
The last optional property, ``node_radius_min_max``, can be used (and is used by default) to scale the node sizes for
126
-
the visualization.
127
-
It is a tuple of two numbers, representing the radii (sizes) in pixels of the smallest and largest nodes respectively in
128
-
the visualization.
129
-
The node sizes will be scaled such that the smallest node will have the size of the first value, and the largest node
130
-
will have the size of the second value.
131
-
The other nodes will be scaled linearly between these two values according to their relative size.
132
-
This can be useful if node sizes vary a lot, or are all very small or very big.
109
+
If you want to include node properties stored at the Neo4j database, you can include them in the visualization by using the `db_node_properties` parameter.
133
110
134
111
135
112
Example
136
113
~~~~~~~
137
114
138
115
In this small example, we import a graph projection from the GDS library, that has the node properties "pagerank" and
139
116
"componentId".
140
-
We use the "pagerank" property to determine the size of the nodes, and the "componentId" property to color the nodes.
117
+
We use the "pagerank" property to compute the size of the nodes, and the "componentId" property to color the nodes.
141
118
142
119
.. code-block:: python
143
120
@@ -156,9 +133,10 @@ We use the "pagerank" property to determine the size of the nodes, and the "comp
156
133
VG= from_gds(
157
134
gds,
158
135
G,
159
-
size_property="pagerank",
160
-
additional_node_properties=["componentId"],
136
+
node_properties=["componentId"],
161
137
)
138
+
# Size the nodes by the `pagerank` property
139
+
VG.resize_nodes(property="pagerank")
162
140
163
141
# Color the nodes by the `componentId` property, so that the nodes are
164
142
# colored by the connected component they belong to
0 commit comments