Skip to content

Add resize_nodes feature to VG#55

Merged
FlorentinD merged 4 commits intomainfrom
resize-nodes
Jan 16, 2025
Merged

Add resize_nodes feature to VG#55
FlorentinD merged 4 commits intomainfrom
resize-nodes

Conversation

@adamnsch
Copy link
Collaborator

@adamnsch adamnsch commented Jan 10, 2025

Thank you for your contribution to the Graph Data Science Client project.

Before submitting this PR, please read Contributing to the Neo4j Ecosystem.

Make sure:

  • You signed the Neo4j CLA (Contributor License Agreement) so that we are allowed to ship your code in our library
  • Your contribution is covered by tests

@adamnsch adamnsch requested a review from FlorentinD January 10, 2025 14:35
height,
)

def resize_nodes(self, sizes: dict[NodeIdType, NodeSizeType]) -> None:
Copy link
Collaborator

Choose a reason for hiding this comment

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

how about allow a simple scalar here as well?
Thinking of the nodes are too small or tiny.

The range-scaling we do during loading using pandas.

Passing a whole dict is very verbose isnt it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah I thought about that too. But if some nodes are missing from the dict, they will use their old size. So scaling the dict would not be enough. And then we would have to scale all the node objects instead. We could do that but we've refrained from doing that in the past since we'd have to iterate through all of them

Copy link
Collaborator

Choose a reason for hiding this comment

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

i would say its fine to iterate through all for this case. What I would refrain from doing is more complicated multi-step computations for this method.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok, I'll see what I can do 👍

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done now, and added some more thorough error handling

adamnsch and others added 2 commits January 15, 2025 14:58
Co-Authored-By: Florentin Dörre <florentin.dorre@neotechnology.com>
Co-Authored-By: Florentin Dörre <florentin.dorre@neotechnology.com>
@FlorentinD FlorentinD merged commit 9afdaa0 into main Jan 16, 2025
7 checks passed
@adamnsch adamnsch deleted the resize-nodes branch January 16, 2025 08:51
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