Mercurial > hg > Members > nobuyasu > html > graphViewer
changeset 45:954a36db47cc draft
refectoring show.html
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 24 Mar 2013 01:30:23 +0900 |
parents | c0666124e00c |
children | a5c65ac33c76 |
files | show.html |
diffstat | 1 files changed, 4 insertions(+), 57 deletions(-) [+] |
line wrap: on
line diff
--- a/show.html Sun Mar 24 00:30:37 2013 +0900 +++ b/show.html Sun Mar 24 01:30:23 2013 +0900 @@ -413,26 +413,6 @@ return position; } -/* - * - */ -function clickNodeDiv(id) { - var graphData = GRAPH_DATA; - var node = graphData.nodes[id]; - var rels = {evidence:1, - dependency:1, - derived:1, - version:1, - agreement:1}; - showRelationNodes(graphData, node, rels); -} - -function addEdgeInfo(id, kind, direction) { - var nodes = GRAPH_DATA.nodes; - var edges = GRAPH_DATA.edges; - -} - function showEdgesAndNodes(graphData,jsonData,kind) { var nodes = graphData.nodes; var jsonNodes = jsonData.nodes; @@ -453,7 +433,7 @@ function getInspect(id) { $.ajax({ url:"/aat/aaevidencesiftingmodel.userdesktops/inspect?id="+id, - success:function(o) { console.log(o); document.location = o; }, + success:function(o) { document.location = o; }, type:"GET", cache:true, error:function(o) { console.log("getEvidence error : ", o); } }); @@ -471,7 +451,7 @@ function postToServer(parameter) { $.ajax({ url:"/aat/aaevidencesiftingmodel.userdesktops/update?desktopid="+desktopid()+"&"+parameter, - success:function(o) { console.log(this.url);}, + success:function(o) {}, type:"POST", cache:true, error:function(o) { console.log("post error : ", o); } }); @@ -498,7 +478,6 @@ function createNodeDiv(node) { node.view = $("<span class='graphNode'/>"); - node.view.click(function(){ clickNodeDiv(node.property.id); }); if(!node.position) { node.position = calcNewNodePosition(); } @@ -546,23 +525,11 @@ return bindObj; } -var TRAVERSE_LI_NAME = "traverseList"; -function createTraverseMenuObj(edgeInfo) { - var bindObj = {}; - bindObj.bindings = {}; - for (var i=0; i<edgeInfo.length; i++) { - var idName = TRAVERSE_LI_NAME + i; - bindObj.bindings[idName] = function(f) { - - } - } - -} - function returnTraverseMenuFunction(edgeInfo) { return function(f){var id = CURRENT_DATA.nodeId; getEvidence(id, edgeInfo); }; } +var TRAVERSE_LI_NAME = "traverseList"; function createTraverseMenuAndObj(edgeInfoArray) { var menu = $('#traverseSelectMenu'); menu.children().remove(); @@ -591,8 +558,6 @@ removeContextMenu(); if (!elem.bindObj) return; var menu = $('#selectMenu'); - console.log("elem.bindObj"); - console.log("menu : ",menu); menu[0].innerHTML = elem.menuHTML; elem.contextMenu('selectMenu', elem.bindObj); } @@ -611,7 +576,7 @@ var div = node.view; setInitContextMenu(node,div); div.hover( - function(){CURRENT_DATA.nodeId = node.property.id; div.css("box-shadow","white 0 0 50px"); console.log('hover'); updateContextMenu(div); }, + function(){CURRENT_DATA.nodeId = node.property.id; div.css("box-shadow","white 0 0 50px"); updateContextMenu(div); }, function(){div.css("box-shadow","");} ); node.view[0].nodeId = node.property.id; @@ -752,24 +717,6 @@ jsPlumb.draggable($('.graphNode')); } -/* - * rels = {dependency:1, evidence:1}; - * showRelationNodes(graphData, node, rels); - */ -function showRelationNodes(graphData, node, rels) { - var id = node.property.id; - var edges = graphData.edges; - var edgeIds = getRelationEdgeIds(node); - for (var i=0; i<edgeIds.length; i++) { - var edge = edges[edgeIds[i]]; - if (rels[edge.property.rel]) { - createNodeFromEdge(graphData, edges[edgeIds[i]]); - } - } - jsPlumb.removeAllEndpoints(); - jsPlumb.draggable($('.graphNode')); -} - var BASE_THETA = -30; var BASE_ANGLE = 180; var BASE_DISTANCE = 180;