|
@@ -31,37 +31,70 @@
|
|
<script type="text/javascript">
|
|
<script type="text/javascript">
|
|
var viz;
|
|
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() {
|
|
function draw() {
|
|
|
|
+ // alert("inside method");
|
|
|
|
+
|
|
var config = {
|
|
var config = {
|
|
container_id: "viz",
|
|
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);
|
|
viz = new NeoVis.default(config);
|
|
|
|
+ console.log(JSON.stringify(viz));
|
|
viz.render();
|
|
viz.render();
|
|
- console.log(viz);
|
|
|
|
-
|
|
|
|
|
|
+ console.log(viz)
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
</head>
|
|
</head>
|
|
<body>
|
|
<body>
|
|
-<div id="viz" style="float:left"></div>
|
|
|
|
|
|
+<div id="viz" style="float:left" onload="draw()" ></div>
|
|
|
|
|
|
-<div>
|
|
|
|
|
|
+<!-- <div>
|
|
<div><h3>Connection Details:</h3>
|
|
<div><h3>Connection Details:</h3>
|
|
|
|
|
|
<label for="url">URL</label><input id="url" name="url" type="text" value="bolt://localhost:7687"/><br/>
|
|
<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="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="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=""/>
|
|
<label for="rel_caption">Caption</label><input id="rel_caption" name="rel_caption" type="text" value=""/>
|
|
-</div>
|
|
|
|
|
|
+</div> -->
|
|
|
|
|
|
|
|
|
|
<div><h3>Cypher query: </h3>
|
|
<div><h3>Cypher query: </h3>
|