nicomp
nicomp

Reputation: 4647

How to programatically update the Neo4j graph that's open in the browser window?

I built a Java desktop app and I can submit commands to the local Neo4j instance with apoc and the cypher. I can add nodes, etc. I also have the graph loaded in a Google Chrome tab. My question is: how do I cause the browser window to update programmatically? I don't want to manually paste in cypher commands in the browser window.

Upvotes: 0

Views: 808

Answers (3)

nicomp
nicomp

Reputation: 4647

Not a perfect solution, but I installed Selenium in the Java project and now I can launch a Firefox browser window, browse to the Neo4j graph server, and inject user input into it all from the comfort of my Java app.

The JavaScript in the Neo4j client does not feature unique identifiers for all the elements in the DOM. I had to hard-code some CSS Selector names to refer to some elements. Therefore, some of my code will break if the those names change in a later release.

Upvotes: 0

cybersam
cybersam

Reputation: 66999

You might want to take a look at the code for the Interactive Neo4j Console, which is a Java app that controls a browser visualization that dynamically updates whenever you ask it to execute Cypher commands. It is the same software used for the Neo4j Console web site.

Upvotes: 1

David Makogon
David Makogon

Reputation: 71055

You cannot programmatically update the neo4j browser to show the results of a specific operation, as it's merely a client connecting to the database.

You'd have to write your own web app to build in some type of dynamic updates.

I guess you could programmatically cause the browser to refresh, but even then, you wouldn't be updating any query results.

Upvotes: 0

Related Questions