Add support for widget + streamlit#399
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a Streamlit integration layer to render neo4j_viz’s existing React-based GraphWidget inside Streamlit using Components v2, with two-way sync for selected and options.
Changes:
- Added
neo4j_viz.streamlit.render_widgetplus a Streamlit v2 frontend entrypoint to bridge state between Streamlit and the widget. - Refactored
GraphWidget’s Pydantic-backed traits to use a reusablePydanticTrait. - Added Streamlit-focused tests, docs, packaging metadata, and an updated Streamlit example.
Reviewed changes
Copilot reviewed 12 out of 16 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| python-wrapper/tests/test_streamlit.py | New tests for Streamlit component rendering, serialization, and state round-trips. |
| python-wrapper/src/neo4j_viz/widget.py | Introduces PydanticTrait and uses it for options/selected/legend. |
| python-wrapper/src/neo4j_viz/streamlit.py | New Streamlit integration module (render_widget) and component declaration. |
| python-wrapper/pyproject.toml | Adds streamlit extra + packages Streamlit build artifacts. |
| python-wrapper/.gitignore | Updates ignore patterns for built frontend artifacts. |
| js-applet/vite.config.streamlit.ts | New Vite build config for Streamlit component bundle output. |
| js-applet/src/streamlit-entrypoint.ts | New Streamlit Components v2 entrypoint + anywidget-model shim. |
| js-applet/package.json | Adds build:streamlit and integrates it into the build pipeline. |
| examples/streamlit-example.py | Updates example to use neo4j_viz.streamlit.render_widget with two-way sync. |
| examples/getting-started.ipynb | Notebook output/execution metadata updates. |
| docs/antora/modules/ROOT/pages/rendering.adoc | Documents Streamlit static rendering and interactive widget sync usage. |
| changelog.md | Notes the new Streamlit integration feature. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
display_widget reads better
FlorentinD
marked this pull request as ready for review
July 10, 2026 15:38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.