Skip to content

Conversation

@FlorentinD
Copy link
Collaborator

@FlorentinD FlorentinD commented Oct 21, 2025

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR simplifies the integration APIs for pandas and GDS by removing automatic node sizing and property-to-field mapping capabilities. Instead of configuring these features through function parameters, users now configure them directly on the VisualizationGraph object after creation.

Key Changes:

  • Removed node_radius_min_max parameter from from_dfs, from_gds, and from_snowflake functions
  • Renamed additional_node_properties to node_properties and additional_db_node_properties to db_node_properties in from_gds
  • Changed integration functions to only map basic fields (id, caption, source, target) instead of all matching field names
  • Added automatic node coloring by label in from_gds

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
python-wrapper/tests/test_pandas.py Updated tests to remove node_radius_min_max parameter and validate nodes store size/color in properties instead of fields
python-wrapper/tests/test_gds.py Removed tests for automatic sizing and validation, updated assertions to include color field, renamed parameter references
python-wrapper/src/neo4j_viz/visualization_graph.py Added comprehensive documentation with examples for VisualizationGraph class and constructor
python-wrapper/src/neo4j_viz/snowflake.py Removed node_radius_min_max parameter and updated documentation
python-wrapper/src/neo4j_viz/relationship.py Added basic_fields_validation_aliases() helper method
python-wrapper/src/neo4j_viz/pandas.py Removed sizing logic and property renaming, changed to only map basic fields as mandatory fields instead of all matching aliases
python-wrapper/src/neo4j_viz/node.py Added basic_fields_validation_aliases() helper method
python-wrapper/src/neo4j_viz/gds.py Removed size property mapping and added automatic node coloring, renamed parameters
docs/source/integration.rst Updated documentation to reflect API changes and new usage patterns
docs/source/conf.py Added sphinx configuration for documentation rendering
changelog.md Documented breaking changes and parameter renames

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


- 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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't quite seem like a bugfix? Just a change? Should we have the same color behaviour for the other constructors then too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes i would suggest to have the same coloring behavior in neo4j and gql. i added it to gds in this PR.

Will do on a follow up PR

In this small example, we import a graph projection from the GDS library, that has the node properties "pagerank" and
"componentId".
We use the "pagerank" property to determine the size of the nodes, and the "componentId" property to color the nodes.
We use the "pagerank" property to set the size of the nodes, and the "componentId" property to color the nodes.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My preference:

Suggested change
We use the "pagerank" property to set the size of the nodes, and the "componentId" property to color the nodes.
We use the "pagerank" property to compute the size of the nodes, and the "componentId" property to color the nodes.


- Validate fields of a node and relationship not only at construction but also on assignment.
- Allow resizing per node property such as `VG.resize_nodes(property="score")`.
- Color nodes by label in `fom_gds`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Color nodes by label in `fom_gds`.
- Color nodes by label in `from_gds`.

Comment on lines +69 to +70
* the caption of a node will be based on its `labels` property.
* the caption of a relationship will be based on its `relationshipType` property.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it's confusing to talk about properties here since they're not actually properties in the GDS sense

Comment on lines +124 to +125
* `id`, and `caption` for the node_dfs
* `id`, `source`, `target`, `caption` for the rel_dfs
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have caption here? Since it's not mandatory I mean. None of the other constructors behave this way?

"""
A graph to visualize.
The `VisualizationGraph` class represents a collection of nodes and relationships that can be
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

Copy link
Collaborator

@adamnsch adamnsch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, nice work! Just added some minor comments/questions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants