user1277546
user1277546

Reputation: 8772

neo4j graph to JSON

I'm considering different options to use Neo4J graph and display it all on the web, at the moment I am considering a Java based reader of the database that creates JSON output for display by the web.

Is JSON suitable for display tree-like structures? In my case I have a parent-child(s) style organisation chart.

Could you give me an example if this is possible. Thanks.

Upvotes: 2

Views: 1149

Answers (1)

eh9
eh9

Reputation: 7430

Yes. Use JSON to pass over all the geometry: lists of nodes and edges, location and sizes of nodes, spline data for edges, etc. Convert all the data to an SVG DOM, which can be done dynamically. (Hint for HTML 4: make sure you use the SVG namespace in CreateElement.) The real trick, more than anything, is to do all the calculations before the data hits the browser. Simple calculations work fine in JavaScript, but anything complicated is best done elsewhere.

No example, unfortunately. The code I wrote is not available to the public.

Upvotes: 1

Related Questions