changeset 13:8b4447c379e5 draft

modified
author Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
date Mon, 24 Sep 2012 15:01:17 +0900
parents 29d39f0e7ee7
children 595ea7792a42
files viewer/dimViewer.html viewer/json/graph.json
diffstat 2 files changed, 66 insertions(+), 47 deletions(-) [+]
line wrap: on
line diff
--- a/viewer/dimViewer.html	Fri Sep 21 17:38:22 2012 +0900
+++ b/viewer/dimViewer.html	Mon Sep 24 15:01:17 2012 +0900
@@ -1,58 +1,75 @@
 <html>
 
-<body onload="main();">
+  <style type="text/css">
+    div.node {
+    background-color:blue; 
+    border-radius:30px; 
+    width:50px; 
+    height:50px;
+    }
+
+    div.node div.outputdiv {
+    border-style:ridge;
+    border-color:red;
+    border-radius:10px;
+    width:150px;
+//    display:none;
+    }
+
+  </style>
 
 
-<div id="node1" style="background-color:blue; border-radius:30px; width:50px; height:50px;"></div>
-<div id="outputdiv" style="border-style:ridge; border-color:red; border-radius:10px; width:150px;">
-  <div style="border-radius:10px; margin-top:5%; margin-left:5%; margin-right:5%; text-align:center; background-color:#ccc;">
-    title
-  </div>
-  <div style="background-color:#ccf;  border-radius:10px; margin:5%;">
-    content 
-    <div>
-    aaaa
-    <div>
-    aaa
-    <div>
-    aaa
-    <div>
-    aaa
-  </div>
-  <div>
+  <body onload="main();">
 
-  </div>
-</div>
+    <div id="node1" class="node" onmouseover="displayDiv(this);">
+      <div class="outputdiv" id="output">
+	<div style="border-radius:10px; margin-top:5px; margin-left:5px; margin-right:5px; text-align:center; background-color:#ccc;">
+	  title
+	</div>
+	<div style="background-color:#ccf;  border-radius:10px; margin:5px; padding:5px;">
+	  content 
+	  <br>
+	  aaaa
+	  <br>
+	  aaa
+	  <br>
+	  aaa
+	  <br>
+	  aaa
+	</div>
+      </div>
+    </div>
 
-<script src="../assets/js/jquery.js"></script>
-<script src="./js/library.js"></script>
-<script>
-  filename = "./json/graph.json"
-  function main() {
-    var output = document.getElementById("outputdiv");
-    var data = loadFile(filename);
-    var jobj = JSON.parse(data);
+    <script src="../assets/js/jquery.js"></script>
+    <script src="./js/library.js"></script>
+    <script>
+      filename = "./json/graph.json"
+      function main() {
+      var node1 = document.getElementById("node1");
+
+      var output = document.getElementById("output");
+      output.style.display = "none";
+      var data = loadFile(filename);
+      var jobj = JSON.parse(data);
 
-    var root = jobj["root"];
-//    output.textContent = "root : " + root;
+      var root = jobj["root"];
+      //    output.textContent = "root : " + root;
 
-    var title =  jobj.Nodes[root].data.title;
-//    output.textContent += "title : " + title;
+      var title =  jobj.Nodes[root].data.title;
+      //    output.textContent += "title : " + title;
 
-    var content = jobj.Nodes[root].data.content;
-//    output.textContent += "content: " + content;
-      
+      var content = jobj.Nodes[root].data.content;
+      //    output.textContent += "content: " + content;
+      }
 
-  
+      function displayDiv(div) {
+        var childDiv = div.childNodes[1]; 
+
+      }
 
 
 
-
-  }
-
-
-
-</script>
-</body>
+    </script>
+  </body>
 
 </html>
--- a/viewer/json/graph.json	Fri Sep 21 17:38:22 2012 +0900
+++ b/viewer/json/graph.json	Mon Sep 24 15:01:17 2012 +0900
@@ -2,25 +2,27 @@
     "root": "Node1",
     "Nodes" : {
 	"Node1" : {
+		"nodeType" : "claim",
 	    "data" : {
 		"title" : "GraphDBは使いやすい。",
 		"content" : "グラフの関係を使った計算がしやすい。"
 	    }
 	},
 	"Node2" : {
+		"nodeType" : "claim",
 	    "data" : {
 		"title" : "RDBでもいいじゃない。",
 		"content" : "RDBには今までの経験がある。"
 	    }
 	},
 	"Node3" : {
-		"type" : "user",
+		"nodeType" : "user",
 	    "data" : {
 		"name" : "user1"
 	    }
 	},
 	"Node4" : {
-		"type" : "user",
+	    "nodeType" : "user",
 	    "data" : {
 		"name" : "user2"
 	    }
@@ -37,7 +39,7 @@
 	"rel2" : {
 	    "from" : "Node1",
 	    "to" : "Node4",
-	    "type" : "agreement request",
+	    "type" : "agreementRequest",
 	    "data" : {
 		"state" : "reserve"
 	    }
@@ -57,7 +59,7 @@
 	"rel5" : {
 	    "from" : "Node2",
 	    "to" : "Node3",
-	    "type" : "agreement request",
+	    "type" : "agreementRequest",
 	    "data" : {
 		"state" : "reserve"
 	    }