That's a bit more involved but you can see it for the different languages in the implementations of http://neo4j.com/developer/language-guides <http://neo4j.com/developer/language-guides>
Michael > Am 23.02.2015 um 21:58 schrieb Arvind Upadhyay <[email protected]>: > > Thanks. > How to fix the same problem while using json response coming from neo4j? > > On Fri, Feb 20, 2015 at 4:06 PM, Michael Hunger > <[email protected] <mailto:[email protected]>> > wrote: > sorry, my bad, > > you have to change the source graph to look like this: > > {"nodes":[{"name":"Peter","label":"Person","id":1},{"name":"Michael","label":"Person","id":2},{"name":"Neo4j","label":"Database","id":3}],"links":[{"source":0, > "target":1, "type":"KNOWS", "since":2010},{"source":0, "target":2, > "type":"FOUNDED"},{"source":1, "target":2, "type":"WORKS_ON"}]}; > > change for the links: > > start -> source > end -> target > > I'll update it on the site. Thanks for being persistent with that and sorry > for not responding earlier. > > Michael > >> Am 20.02.2015 um 17:22 schrieb Arvind Upadhyay <[email protected] >> <mailto:[email protected]>>: >> >> Html code here in case not clear in the attachment >> >> >> >> <html> >> <head> >> <title>Home</title> >> <script type="text/javascript" src="http://d3js.org/d3.v3.min.js >> <http://d3js.org/d3.v3.min.js>"></script> >> <script >> src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js >> <https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js>"></script> >> <script >> src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/jquery-ui.min.js >> <https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/jquery-ui.min.js>"></script> >> <script type="text/javascript" src="/neopoc/static/js/poc.js"></script> >> <link rel="stylesheet" href="/neopoc/static/css/poc.css" /> >> </head> >> <body> >> <div id="brs_header"> >> <div id="brs_red_block"></div> >> <div id="brs_gradient"></div> >> <div id="brs_space"></div> >> </div> >> <div class="graphContainer" id="graph"> >> >> >> </div> >> <div id="brs_footer"> >> <div id="app_footer"></div> >> <div id="common_footer"></div> >> </div> >> </body> >> </html> >> >> On Fri, Feb 20, 2015 at 11:20 AM, Arvind Upadhyay >> <[email protected] <mailto:[email protected]>> wrote: >> Hi Micheal, >> >> I tried a simpler example w/o using other scripts (only d3 and >> javascript)..i still see the same problem >> >> Attached is the java script and the html. >> >> "/neopoc/graph" call from frontend returns the following string from server >> side. >> >> String sample = >> "{\"nodes\":[{\"name\":\"Peter\",\"label\":\"Person\",\"id\":1},{\"name\":\"Michael\",\"label\":\"Person\",\"id\":2},{\"name\":\"Neo4j\",\"label\":\"Database\",\"id\":3}],\"links\":[{\"start\":0, >> \"end\":1, \"type\":\"KNOWS\", \"since\":2010},{\"start\":0, \"end\":2, >> \"type\":\"FOUNDED\"},{\"start\":1, \"end\":2, \"type\":\"WORKS_ON\"}]}"; >> >> Error i get is >> Uncaught TypeError: Cannot read property 'weight' of >> undefinedd3.v3.min.js:4 ta.layout.force.a.startpoc.js:19 (anonymous >> function)d3.v3.min.js:1 (anonymous function)d3.v3.min.js:1 td3.v3.min.js:1 u >> >> >> I tried this long back as well but could not successfully build a poc...any >> help here would be great. >> >> >> Thanks >> Arvind >> >> >> >> >> On Thu, Feb 5, 2015 at 10:37 PM, Arvind Upadhyay <[email protected] >> <mailto:[email protected]>> wrote: >> got a chance to look at the html and js? >> >> On Wed, Feb 4, 2015 at 5:59 PM, Arvind Upadhyay <[email protected] >> <mailto:[email protected]>> wrote: >> attached is the index.html and dependency.js (that tries to draw the graph). >> >> div used for graph is dependecyMgmt. >> >> Appreciate your help. >> >> On Wed, Feb 4, 2015 at 5:50 PM, Michael Hunger >> <[email protected] <mailto:[email protected]>> >> wrote: >> Please share the HTML of your JSP. >> >> I can't help with vague snippets ... >> >> M >> >>> Am 04.02.2015 um 23:46 schrieb Arvind Upadhyay <[email protected] >>> <mailto:[email protected]>>: >>> >>> This is what i do >>> >>> i have a jsp with an empty div graph. on the client side(i also use other >>> javascripts library like masonary.js,datatables and jquery), i load the >>> doc, make ajax call get the data (from neo4j in a graphical centric) and >>> then try to display using the code i pasted in previous conversation. >>> >>> On Wed, Feb 4, 2015 at 5:31 PM, Michael Hunger >>> <[email protected] >>> <mailto:[email protected]>> wrote: >>> can you share your full html document? >>> >>> M >>> >>>> Am 04.02.2015 um 17:09 schrieb Arvind Upadhyay <[email protected] >>>> <mailto:[email protected]>>: >>>> >>>> One more thing >>>> >>>> if you try to override the response from server side in your working app >>>> var graph = >>>> {"nodes":[{name:"Peter",label:"Person",id:1},{name:"Michael",label:"Person",id:2}, >>>> >>>> {name:"Neo4j",label:"Database",id:3}], >>>> "links":[{start:0, >>>> end:1, type:"KNOWS", since:2010},{start:0, end:2, type:"FOUNDED"}, >>>> {start:1, >>>> end:2, type:"WORKS_ON"}]}; >>>> >>>> you might get the same error. Is this something related to the format of >>>> data ? >>>> >>>> >>>> >>>> On Wed, Feb 4, 2015 at 9:36 AM, Arvind Upadhyay >>>> <[email protected] <mailto:[email protected]>> wrote: >>>> i checked the version but no luck. I am sure i am missing somthing...not >>>> sure whr though? >>>> in my html i have an empty div with dependencyMgmt as the id. >>>> >>>> On Tue, Feb 3, 2015 at 5:40 PM, Michael Hunger >>>> <[email protected] >>>> <mailto:[email protected]>> wrote: >>>> Could you try to use the d3 version that we use here: >>>> >>>> https://github.com/neo4j-contrib/developer-resources/blob/gh-pages/language-guides/assets/index.html#L87 >>>> >>>> <https://github.com/neo4j-contrib/developer-resources/blob/gh-pages/language-guides/assets/index.html#L87> >>>> http://d3js.org/d3.v3.min.js <http://d3js.org/d3.v3.min.js> >>>> >>>> In action: http://my-neo4j-movies-app.herokuapp.com/ >>>> <http://my-neo4j-movies-app.herokuapp.com/> >>>> >>>> Michael >>>> >>>>> Am 03.02.2015 um 21:29 schrieb Arvind Upadhyay >>>>> <[email protected] <mailto:[email protected]>>: >>>>> >>>>> >>>>> hello guys, this question is more d3 centric than neo4j based. I copied >>>>> the example from neo4j website for visualization and it does not seem to >>>>> work. >>>>> >>>>> I am using latest version of d3.js to prototype visualization using neo4j. >>>>> Error seems to be from d3.js library itself >>>>> Uncaught TypeError: Cannot read property 'weight' of undefined >>>>> d3.min.js:4 >>>>> >>>>> >>>>> here is the code i copied from neo4j site ("dependencyManager" is the id >>>>> of svg element) >>>>> >>>>> >>>>> res = >>>>> {"nodes":[{name:"Peter",label:"Person",id:1},{name:"Michael",label:"Person",id:2}, >>>>> >>>>> {name:"Neo4j",label:"Database",id:3}], >>>>> "links":[{start:0, >>>>> end:1, type:"KNOWS", since:2010},{start:0, end:2, type:"FOUNDED"}, >>>>> {start:1, >>>>> end:2, type:"WORKS_ON"}]}; >>>>> >>>>> >>>>> >>>>> var graph = >>>>> {"nodes":[{name:"Peter",label:"Person",id:1},{name:"Michael",label:"Person",id:2}, >>>>> >>>>> {name:"Neo4j",label:"Database",id:3}], >>>>> "links":[{start:0, >>>>> end:1, type:"KNOWS", since:2010},{start:0, end:2, type:"FOUNDED"}, >>>>> {start:1, >>>>> end:2, type:"WORKS_ON"}]}; >>>>> >>>>> var width = 800, >>>>> height = 800; >>>>> // force layout setup >>>>> var force = >>>>> d3.layout.force() >>>>> >>>>> .charge(-200).linkDistance(30).size([width, height]); >>>>> >>>>> // setup svg div >>>>> var svg = >>>>> d3.select("#dependencyManager") >>>>> .attr("width", >>>>> "100%").attr("height", "100%") >>>>> >>>>> .attr("pointer-events", "all"); >>>>> >>>>> // load graph >>>>> (nodes,links) json from /graph endpoint >>>>> >>>>> >>>>> >>>>> >>>>> force.nodes(graph.nodes).links(graph.links).start(); >>>>> >>>>> // render >>>>> relationships as lines >>>>> var link = >>>>> svg.selectAll(".link") >>>>> >>>>> .data(graph.links).enter() >>>>> >>>>> .append("line").attr("class", "link"); >>>>> >>>>> // render nodes as >>>>> circles, css-class from label >>>>> var node = >>>>> svg.selectAll(".node") >>>>> >>>>> .data(graph.nodes).enter() >>>>> >>>>> .append("circle") >>>>> >>>>> .attr("class", function (d) { return "node "+d.label }) >>>>> .attr("r", >>>>> 10) >>>>> >>>>> .call(force.drag); >>>>> >>>>> // html title >>>>> attribute for title node-attribute >>>>> node.append("title") >>>>> >>>>> .text(function (d) { return d.title; }) >>>>> >>>>> // force feed algo >>>>> ticks for coordinate computation >>>>> force.on("tick", >>>>> function() { >>>>> link.attr("x1", >>>>> function(d) { return d.source.x; }) >>>>> >>>>> .attr("y1", function(d) { return d.source.y; }) >>>>> >>>>> .attr("x2", function(d) { return d.target.x; }) >>>>> >>>>> .attr("y2", function(d) { return d.target.y; }); >>>>> >>>>> node.attr("cx", >>>>> function(d) { return d.x; }) >>>>> >>>>> .attr("cy", function(d) { return d.y; }); >>>>> }); >>>>> >>>>> -- >>>>> You received this message because you are subscribed to the Google Groups >>>>> "Neo4j" group. >>>>> To unsubscribe from this group and stop receiving emails from it, send an >>>>> email to [email protected] >>>>> <mailto:[email protected]>. >>>>> For more options, visit https://groups.google.com/d/optout >>>>> <https://groups.google.com/d/optout>. >>>> >>>> >>>> -- >>>> You received this message because you are subscribed to a topic in the >>>> Google Groups "Neo4j" group. >>>> To unsubscribe from this topic, visit >>>> https://groups.google.com/d/topic/neo4j/REh1ZJnU80s/unsubscribe >>>> <https://groups.google.com/d/topic/neo4j/REh1ZJnU80s/unsubscribe>. >>>> To unsubscribe from this group and all its topics, send an email to >>>> [email protected] >>>> <mailto:[email protected]>. >>>> For more options, visit https://groups.google.com/d/optout >>>> <https://groups.google.com/d/optout>. >>>> >>>> >>>> >>>> -- >>>> You received this message because you are subscribed to the Google Groups >>>> "Neo4j" group. >>>> To unsubscribe from this group and stop receiving emails from it, send an >>>> email to [email protected] >>>> <mailto:[email protected]>. >>>> For more options, visit https://groups.google.com/d/optout >>>> <https://groups.google.com/d/optout>. >>> >>> >>> -- >>> You received this message because you are subscribed to a topic in the >>> Google Groups "Neo4j" group. >>> To unsubscribe from this topic, visit >>> https://groups.google.com/d/topic/neo4j/REh1ZJnU80s/unsubscribe >>> <https://groups.google.com/d/topic/neo4j/REh1ZJnU80s/unsubscribe>. >>> To unsubscribe from this group and all its topics, send an email to >>> [email protected] >>> <mailto:[email protected]>. >>> For more options, visit https://groups.google.com/d/optout >>> <https://groups.google.com/d/optout>. >>> >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Neo4j" group. >>> To unsubscribe from this group and stop receiving emails from it, send an >>> email to [email protected] >>> <mailto:[email protected]>. >>> For more options, visit https://groups.google.com/d/optout >>> <https://groups.google.com/d/optout>. >> >> >> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "Neo4j" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/neo4j/REh1ZJnU80s/unsubscribe >> <https://groups.google.com/d/topic/neo4j/REh1ZJnU80s/unsubscribe>. >> To unsubscribe from this group and all its topics, send an email to >> [email protected] >> <mailto:[email protected]>. >> For more options, visit https://groups.google.com/d/optout >> <https://groups.google.com/d/optout>. >> >> >> >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Neo4j" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] >> <mailto:[email protected]>. >> For more options, visit https://groups.google.com/d/optout >> <https://groups.google.com/d/optout>. > > > -- > You received this message because you are subscribed to a topic in the Google > Groups "Neo4j" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/neo4j/REh1ZJnU80s/unsubscribe > <https://groups.google.com/d/topic/neo4j/REh1ZJnU80s/unsubscribe>. > To unsubscribe from this group and all its topics, send an email to > [email protected] > <mailto:[email protected]>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. > > > -- > You received this message because you are subscribed to the Google Groups > "Neo4j" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <mailto:[email protected]>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. -- You received this message because you are subscribed to the Google Groups "Neo4j" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
