Skip to content

Replace pygraphviz with neo4j-viz for graph visualization #306

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

oskarhane
Copy link
Member

@oskarhane oskarhane commented Mar 14, 2025

Neo4j has its own viz library, let's use that!

  • Replace pygraphviz imports with neo4j-viz in pipeline.py
  • Update draw() method to save visualizations as HTML files
  • Implement get_neo4j_viz_graph() method for interactive visualizations
  • Update example in visualization.py to use HTML output
  • Update tests to work with neo4j-viz implementation
  • Add color coding for better visual distinction

Type of Change

  • New feature
  • Bug fix
  • Breaking change
  • Documentation update
  • Project configuration change

How Has This Been Tested?

  • Unit tests
  • E2E tests
  • Manual tests

Checklist

The following requirements should have been met (depending on the changes in the branch):

  • Unit tests have been updated
  • Examples have been updated
  • CHANGELOG.md updated if appropriate

@oskarhane oskarhane requested a review from a team as a code owner March 14, 2025 14:45
@oskarhane oskarhane force-pushed the feature/replace-pygraphviz-with-neo4j-viz branch from 1cb21f1 to 0a14de3 Compare April 4, 2025 10:27
@oskarhane oskarhane requested a review from stellasia April 4, 2025 12:08
@oskarhane oskarhane force-pushed the feature/replace-pygraphviz-with-neo4j-viz branch from 2916e37 to 54fe2eb Compare April 4, 2025 14:46
@stellasia
Copy link
Contributor

Just realized we can remove pygraphviz install from the GH actions (pr-e2e-tests and maybe others)

This commit replaces pygraphviz with neo4j-viz for pipeline visualization, providing a more interactive HTML-based visualization experience. The changes include:

- Updated the Pipeline.draw() method to generate HTML output using neo4j-viz
- Added a new get_neo4j_viz_graph() method while maintaining backward compatibility
- Updated dependencies in pyproject.toml to use neo4j-viz instead of pygraphviz
- Updated documentation and examples to reflect the change from PNG to HTML output
- Updated unit tests to work with the new visualization implementation
- Added stub file for neo4j-viz to make mypy happy

Delete tmp file

Update README

Make internal method private

Remove unnecessary formatting

Better error message when trying to use without having it installed

Add header to new file
@oskarhane oskarhane force-pushed the feature/replace-pygraphviz-with-neo4j-viz branch from 1813632 to 225237b Compare April 24, 2025 08:27
@oskarhane oskarhane requested a review from stellasia April 24, 2025 09:21
Copy link
Contributor

@stellasia stellasia left a comment

Choose a reason for hiding this comment

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

🕸️

@oskarhane oskarhane merged commit 7814c21 into neo4j:main Apr 24, 2025
7 checks passed
@oskarhane oskarhane deleted the feature/replace-pygraphviz-with-neo4j-viz branch April 24, 2025 11:37
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.

3 participants