new_example.html 3.4 KB

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