new_example.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <title>
  6. Patents View neo4j
  7. </title>
  8. <style type="text/css">
  9. html,
  10. body,
  11. input,
  12. textarea {
  13. font: 10pt arial;
  14. }
  15. #viz {
  16. width: 75%;
  17. height: 700px;
  18. border: 1px solid lightgray;
  19. font: 22pt arial;
  20. margin: 10px;
  21. }
  22. label {
  23. display: inline-block;
  24. width: 10em;
  25. }
  26. </style>
  27. <link href="style.css" rel="stylesheet" />
  28. <script src="http://code.jquery.com/jquery-2.0.3.min.js" data-semver="2.0.3" data-require="jquery"></script>
  29. <script src="https://rawgit.com/neo4j-contrib/neovis.js/master/dist/neovis.js"></script>
  30. <script type="text/javascript">
  31. var viz;
  32. function draw() {
  33. // alert("inside method");
  34. var config = {
  35. container_id: "viz",
  36. server_url: "bolt://50.211.199.151:7687",
  37. server_user: "neo4j",
  38. server_password: "test",
  39. arrows: true,
  40. labels: {
  41. "Patent": {
  42. "caption": "patent_no"
  43. },
  44. "Application": {
  45. "caption": "application_id"
  46. },
  47. "Inventor": {
  48. "caption": "inventor_name"
  49. },
  50. "Case": {
  51. "caption": "case_id"
  52. },
  53. "Court": {
  54. "caption": "court_id"
  55. },
  56. "Expert": {
  57. "caption": "expert_name"
  58. },
  59. "Firm": {
  60. "caption": "firm_name"
  61. },
  62. "Inventor": {
  63. "caption": "inventor_name"
  64. },
  65. "Party": {
  66. "caption": "party_name"
  67. },
  68. "Phrase": {
  69. "caption": "key_phrase"
  70. },
  71. "Acronym": {
  72. "caption": "acronym"
  73. },
  74. "Attorney": {
  75. "caption": "attorney_name"
  76. }
  77. },
  78. relationships: {
  79. },
  80. initial_cypher: "MATCH (n)-[r:CITES]->(m) RETURN n,r,m LIMIT 25"
  81. };
  82. viz = new NeoVis.default(config);
  83. console.log(JSON.stringify(viz));
  84. viz.render();
  85. console.log(viz)
  86. }
  87. </script>
  88. </head>
  89. <body>
  90. <div id="viz" style="float:left" onload="draw()"></div>
  91. Cypher query: <textarea rows="4" cols=50 id="cypher"></textarea><br>
  92. <input type="submit" value="Submit" id="reload">
  93. <input type="submit" value="Stabilize" id="stabilize">
  94. </body>
  95. <script>
  96. $(document).ready(function () {
  97. draw();
  98. })
  99. $("#reload").click(function () {
  100. var cypher = $("#cypher").val();
  101. if (cypher.length > 3) {
  102. viz.renderWithCypher(cypher);
  103. } else {
  104. console.log("reload");
  105. viz.reload();
  106. }
  107. });
  108. $("#stabilize").click(function () {
  109. viz.stabilize();
  110. })
  111. </script>
  112. <!--
  113. <body>
  114. <div>
  115. <div id="row2">
  116. <input type="button" value="click" onclick="draw()">
  117. <div id="viz"></div>
  118. </div>
  119. </form>
  120. </div>
  121. </body>
  122. </html>
  123. -->