Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 10, 2025

Changes the default value of the override parameter in VisualizationGraph.color_nodes() from False to True, making the method override existing node colors by default rather than preserving them.

Changes

  • API change: color_nodes() now defaults to override=True
    • Previous behavior: existing colors preserved unless override=True explicitly passed
    • New behavior: existing colors overridden unless override=False explicitly passed
  • Tests: Added coverage for new default behavior and explicit override=False usage
  • Changelog: Added entry in changelog.md under "Breaking changes" section documenting the API behavior change

Example

nodes = [
    Node(id="0", caption="Person", color="#FF0000"),  # existing red
    Node(id="1", caption="Product", color="#FF0000"), # existing red
]
VG = VisualizationGraph(nodes=nodes)

# Before: nodes keep red color
# After: nodes get new colors from color scheme
VG.color_nodes(field="caption", colors={"Person": "#000000", "Product": "#00FF00"})

# To preserve existing colors, now explicitly pass override=False
VG.color_nodes(field="caption", colors={...}, override=False)

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
Original prompt

This section details on the original issue you should resolve

<issue_title>Change default for the override parameter on VG.color_nodes</issue_title>
<issue_description>As most integrations now apply coloring by default, I think its better to override existing colors by default and only have it as an option to preserve existing colors.

This means we would change the default of the override parameter from False to True</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Change default value for override parameter in VG.color_nodes Change default for override parameter in color_nodes from False to True Nov 10, 2025
Copilot finished work on behalf of FlorentinD November 10, 2025 13:46
Copilot AI requested a review from FlorentinD November 10, 2025 13:46
@FlorentinD
Copy link
Collaborator

@copilot add a changelog entry as well

Copy link
Contributor Author

Copilot AI commented Nov 10, 2025

@copilot add a changelog entry as well

Added changelog entry in commit 7628c55. The change is documented under "Breaking changes" since it alters the default API behavior.

Copilot finished work on behalf of FlorentinD November 10, 2025 13:57
@FlorentinD FlorentinD marked this pull request as ready for review November 10, 2025 14:21
@FlorentinD FlorentinD merged commit 557d21f into main Nov 10, 2025
12 checks passed
@s1ck
Copy link
Contributor

s1ck commented Nov 10, 2025

Wow :)

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.

Change default for the override parameter on VG.color_nodes

3 participants