Преглед на файлове

updated html files to display the required graphs

Yashasvi Bari преди 2 години
родител
ревизия
00977081f3
променени са 2 файла, в които са добавени 56 реда и са изтрити 23 реда
  1. 54 21
      neovis.js-master/examples/form-example.html
  2. 2 2
      neovis.js-master/examples/new_example.html

+ 54 - 21
neovis.js-master/examples/form-example.html

@@ -31,37 +31,70 @@
     <script type="text/javascript">
         var viz;
 
+        // function draw() {
+        //     var config = {
+        //         container_id: "viz",
+        //         server_url: $("#url").val(),
+        //         server_user: $("#user").val(),
+        //         server_password: $("#pass").val(),
+        //         labels: {},
+        //         relationships: {},
+        //         initial_cypher: $("#cypher").val()
+        //     };
+        //     config.labels[$("#label").val()] = {
+        //         "caption": $("#caption").val(),
+        //         "size": $("#size").val(),
+        //         "community": $("#community").val(),
+        //         //"sizeCypher": "MATCH (n) WHERE id(n) = {id} MATCH (n)-[r]-() RETURN sum(r.weight) AS c"
+        //     };
+        //     config.relationships[$("#rel_type").val()] = {
+        //         "thickness": $("#thickness").val(),
+        //         "caption": $("#rel_caption").val(),
+        //     }
+        //     viz = new NeoVis.default(config);
+        //     viz.render();
+        //     console.log(viz);
+
+        // }
+
         function draw() {
+            // alert("inside method");
+
             var config = {
                 container_id: "viz",
-                server_url: $("#url").val(),
-                server_user: $("#user").val(),
-                server_password: $("#pass").val(),
-                labels: {},
-                relationships: {},
-                initial_cypher: $("#cypher").val()
-            };
-            config.labels[$("#label").val()] = {
-                "caption": $("#caption").val(),
-                "size": $("#size").val(),
-                "community": $("#community").val(),
-                //"sizeCypher": "MATCH (n) WHERE id(n) = {id} MATCH (n)-[r]-() RETURN sum(r.weight) AS c"
+                server_url: "bolt://50.211.199.151:7687",
+                server_user: "neo4j",
+                server_password: "test",
+                arrows: true,
+                labels: {
+                    "Patent": {
+                        "caption": "patent_no"
+                    },
+                    "Application": {
+                        "caption": "application_no"
+                    },
+                    "Inventor": {
+                        "caption": "inventor_name"
+                    }
+
+                },
+                relationships: {
+
+                },
+                initial_cypher: "MATCH (n)-[r:CITES]->(m) RETURN n,r,m LIMIT 25"
             };
-            config.relationships[$("#rel_type").val()] = {
-                "thickness": $("#thickness").val(),
-                "caption": $("#rel_caption").val(),
-            }
+
             viz = new NeoVis.default(config);
+            console.log(JSON.stringify(viz));
             viz.render();
-            console.log(viz);
-
+            console.log(viz)
         }
     </script>
 </head>
 <body>
-<div id="viz" style="float:left"></div>
+<div id="viz" style="float:left" onload="draw()" ></div>
 
-<div>
+<!-- <div>
 <div><h3>Connection Details:</h3>
 
 <label for="url">URL</label><input id="url" name="url" type="text" value="bolt://localhost:7687"/><br/>
@@ -83,7 +116,7 @@
 <label for="type">Relationship-Type</label><input id="type" name="type" type="text" value="INTERACTS"/><br/>
 <label for="thickness">Thickness</label><input id="thickness" name="thickness" type="text" value="weight"/><br/>
 <label for="rel_caption">Caption</label><input id="rel_caption" name="rel_caption" type="text" value=""/>
-</div>
+</div> -->
 
 
 <div><h3>Cypher query: </h3>

+ 2 - 2
neovis.js-master/examples/new_example.html

@@ -59,8 +59,8 @@
     </script>
 </head>
 
-<body onload="draw()">
-    <div id="viz"></div>
+<body >
+    <div id="viz" onload="draw()"></div>
 
 
     Cypher query: <textarea rows="4" cols=50 id="cypher"></textarea><br>