- 
                Notifications
    You must be signed in to change notification settings 
- Fork 54
Add notebook for visualizing projections with PyVis #766
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
base: main
Are you sure you want to change the base?
Conversation
450af65    to
    a696278      
    Compare
  
    | ✅ Deploy Preview for neo4j-graph-data-science-client ready!
 To edit notification comments on pull requests, go to your Netlify site configuration. | 
| ✅ Deploy Preview for neo4j-graph-data-science-client canceled.
 | 
| [source, python, role=no-test] | ||
| ---- | ||
| net = Network(notebook = True, | ||
| cdn_resources="remote", | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought ruff would fix this ugly indentation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be able to format notebooks according to https://docs.astral.sh/ruff/configuration/#jupyter-notebook-discovery
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue with our setup .. see #768
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried after rebasing on main, but the formatting issue remains the same after running makestyle locally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
likely wrong pandoc version installed locally.
| It would be nice to include either a html or image for the visualization in the docs somehow... | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice start!
Looking forward to extend this notebook with other options.
| [source, python, role=no-test] | ||
| ---- | ||
| net = Network(notebook = True, | ||
| cdn_resources="remote", | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be able to format notebooks according to https://docs.astral.sh/ruff/configuration/#jupyter-notebook-discovery
| looked a bit into the convert.sh complain ... resulted in #767 use the correct version in  | 
| 
 Ok, nice! I will have a look | 
Co-Authored-By: Florentin Dörre <florentin.dorre@neotechnology.com>
86cb0cd    to
    090f008      
    Compare
  
    | Unsuprisingly we can see that papers largely seem clustered by academic | ||
| subject. We also note that some nodes appear larger in size, indicating | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just the visualization does not explain to us what the academic subjects are right?
How about we add the subject as a label?
| @adamnsch updated pandoc on CI -> the checkstyle should go green now 🤞 | 
| 
 Excellent work 👏 | 
d121e3c    to
    511a18b      
    Compare
  
    511a18b    to
    0703121      
    Compare
  
    | = Visualizing GDS Projections | ||
|  | ||
|  | ||
| https://colab.research.google.com/github/neo4j/graph-data-science-client/blob/main/examples/import-sample-export-gnn.ipynb[image:https://colab.research.google.com/assets/colab-badge.svg[Open | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it a wrong link?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea to pull the logic into a graph method for convenience
| an interactive graphical visualization of the specified graph | ||
| """ | ||
|  | ||
| actual_node_properties = list(chain.from_iterable(self.node_properties().to_dict().values())) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can reduce it to set()
| if visual_graph != self._name: | ||
| self._query_runner.call_procedure( | ||
| endpoint="gds.graph.drop", | ||
| params=CallParameters(graph_name=visual_graph), | ||
| custom_error=False, | ||
| ) | ||
| elif clean_up_size_prop: | ||
| self._query_runner.call_procedure( | ||
| endpoint="gds.graph.nodeProperties.drop", | ||
| params=CallParameters(graph_name=visual_graph, nodeProperties=size_property), | ||
| custom_error=False, | ||
| ) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to have its own Graph.sample method and warn if the graph is too big.
Would avoid side-effect, the user is not aware off.
| ] | ||
| return f"{self.__class__.__name__}({self._graph_info(yields=yield_fields).to_dict()})" | ||
|  | ||
| def visualize( | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i like the idea of this.
maybe we can have different backends to be used?
pyvis/nvl?  (with default to nvl)
should have a thought on the dependency. Likely similar optional dependency as for networkx
| #772 is the PR to allow replacing outputs for the doc version. Not yet ready but closing in :) | 

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: