GithubHelp home page GithubHelp logo

merqurio / neo4jupyter Goto Github PK

View Code? Open in Web Editor NEW
132.0 12.0 30.0 166 KB

A quick visualization tool for Jupyter and Neo4J

License: MIT License

HTML 12.34% Python 87.66%
graph neo4j jupyter visualization visjs

neo4jupyter's Introduction

neo4jupyter

A tool to visualize graph database queries from Neo4j in the Jupyter Notebook.

Install

pip install neo4jupyter

screen shot 2016-04-15 at 13 13 33

Docs

First thing you must do is call the neo4jupyter.init_notebook_mode() to load all the javascript.

import neo4jupyter
neo4jupyter.init_notebook_mode()

Drawing a graph it's as easy as giving the funcion neo4jupyter.draw() the py2neo graph object and the parameters that you want to be displayed. An example of the settings for the movie graph tutorial, options = {"Movie": "title", "Person": "name"} will show the nodes Person and Movie by title and name consecutively and their connexions.

neo4jupyter.draw(graph_object_py2neo, {"Nodes_type": "Att", …})

I encourage you to read the neo4jupyter.py file, is small and subject to be enhanced.

Licence

The MIT License (MIT) | See LICENSE.md Copyright (c) 2015, 2016, 2017, 2018 Gabriel de Maeztu, Marcus Rehm, Bruce Lowther

neo4jupyter's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

neo4jupyter's Issues

Export as an html file

Is there any way to export the result on jupyter notebook as html?I need it badly and I would really appreciate it if this can be solved

Suggestion for handling subgraphs

I have need of presenting a subgraph (py2neo.Subgraph) and this package is close to what I would like to do. (thank you for publishing it on github) Have code to enhance to present subgraph in cases where you want to show what will be merged or want to select a subset of nodes out of a graph for presentation. Are you interested in taking new pull requests? (i'm new to that process, but thought I would give it a go if you're interested.)

screen shot 2018-04-20 at 21 30 39

Example code of proposed function draw_subgraph

from py2neo import Graph, Node, Relationship, NodeSelector, Subgraph, remote
import neo4jupyter
import vis
neo4jupyter.init_notebook_mode()
class Knows(Relationship): pass
class Dates(Relationship): pass
class Despises(Relationship): pass
class Person(Node): pass
sam = Node('Person', Name = 'Sam')
bob = Node('Person', Name = 'Bob')
george = Node('Person', Name = 'George')
suzy = Node('Person', Name = 'Suzy')

sg = Knows(bob, sam)
sg |= Knows(sam, suzy) 
sg |= Dates(bob, suzy)
sg |= Despises(george, bob)
neo4jupyter.draw_subgraph(sg, options = {"Person": "Name"})`

physics

Hi

Is there a way to change, adapt the physics, by passing parameters? This would be great for my use case, but I didn't manage to do it. Somehow the code looks like there are DEFAULT_PHYSICS but changing this constant, had no influence on the output.

Secondly, I wrote an adapted function to use neo4jupyter with the python graph data science package (gds.run_cypher). If you are interested, I would love to commit the code.

Thank you!

TypeError: 'LabelSetView' object is not callable

I thought this was solved, but it does not actually seem to be.
Is there a chance that a newer version of py2neo has a breaking change?

It seems to have something to do with the labels attribute. In fact... the query in neo4jupyter.py does not seem to be actually returning any objects (not sure the proper terminology here):

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.