Mercurial > hg > Members > nobuyasu > html > graphViewer
changeset 26:b6031eb79cc0 draft
remove unnecesarry code
author | Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 22 Mar 2013 06:24:46 +0900 |
parents | a51dd2e558ab |
children | 992372c53479 |
files | show.html |
diffstat | 1 files changed, 10 insertions(+), 147 deletions(-) [+] |
line wrap: on
line diff
--- a/show.html Fri Mar 22 06:10:27 2013 +0900 +++ b/show.html Fri Mar 22 06:24:46 2013 +0900 @@ -29,29 +29,6 @@ </ul> <script type="text/javascript">var _desktopid = ${desktop.id};function desktopid(){return _desktopid;}</script> -<!-- -<div id="traverseDisplay" style='position:fixed; width:250px; height:250px; border:solid -1px; border-radius:5px; opacity:1; z-index:10; visibility:visible;'> - <div style='position:absolute; left:0; top:0; width:100%; height:100%; background:black; opacity:0.7;'></div> - <div id="closeTraverseDisplay" style='position:absolute; right:5px; top:-3px; z-index:10; color:white;' onclick="$('#traverseDisplay').css('visibility','hidden');" onmouseover="$('#closeTraverseDisplay').css('color','yellow');" onmouseout="$('#closeTraverseDisplay').css('color','white')" >CLOSE</div> - <div style='position:absolute; width:90%; height:90%;'> - <div style='position:absolute; left:5%; top:5%; width:100%; height:100%; background:white;'> - <div id="traverseDisplayTitle" style='position:absolute; left:10px; top:5px; font-size:24px; width:100%; text-align:left;'> - Traverse - </div> - <div style='position:absolute; top:30px; width:100%; margin-left:10px;'> Direction: - <label style='position:relative;' ><input id="direction_in" type='radio' value='in' name='direction' checked value='in' checked />IN</label> - <label style='position:relative;'><input id="direction_out" type='radio' value='out' name='direction' value='out'/>OUT</label> - </form> - </div> - <div id="traverseDisplayBody" style='position:absolute; left:20px; top:50px;'> - Please click any node. - </div> - </div> - </div> - <span class='button' style='position:absolute; width:100px; left:75px; bottom:5px; opacity:1;' onclick='traverseAction();'>traverse</span> -</div> ---> <div id="miniDisplay" style='position:fixed; width:250px; height:250px; border:solid 1px; border-radius:5px; opacity:1; z-index:10; visibility:visible;'> <div style='position:absolute; left:0; top:0; width:100%; height:100%; background:black; opacity:0.5;'></div> @@ -74,12 +51,6 @@ </div> - -<div class="graphMainCss" style="position:absolute; left:0; bottom:0; width:100%; height:75%;" id='graphMain'> - <div style="position:absolute; width:0; height:0;left:0;" id='graphRoot'> - </div> -</div> - <div id='edgeInfoDisplay' class='edgeInfoTable' style='left:0; top:0; z-index:20;'> <div id="closeEdgeInfoDisplay" style='position:absolute; right:5px; top:-15px; z-index:10; color:white;' onclick="$('#edgeInfoDisplay').css('visibility','hidden');" onmouseover="$('#closeEdgeInfoDisplay').css('color','yellow');" onmouseout="$('#closeEdgeInfoDisplay').css('color','white')" >CLOSE</div> <div id='edgeInfoTitle' style='position:absolute; margin-top:2px; padding-left:5px; font-size:20px; width:100%; text-align:left;'>Traverse</div> <div id='edgeInfoSample' style='position:absolute; padding-left:10px; font-size:15px; padding-top:25px;'>kind : num : direction</div> @@ -89,6 +60,12 @@ </div> +<div class="graphMainCss" style="position:absolute; left:0; bottom:0; width:100%; height:75%;" id='graphMain'> + <div style="position:absolute; width:0; height:0;left:0;" id='graphRoot'> + </div> +</div> + + <script type="text/javascript"> var CURRENT_DATA = {}; @@ -195,54 +172,6 @@ writeMiniDisplay(jsonObj.property.title, str); } -//remove -/* -function getTraverseDivTemplate(kind, inNum, outNum) { - return "<div><label id='traverseLabel'><input type='checkbox' checked value='"+kind+"'/>"+kind+"</label><br>in:"+inNum+" out:"+outNum+"</div>"; -} - */ - -//remove -/* -function createTraverseView(info) { - var viewHtml = ""; - for (var kind in info) { - var data = info[kind]; - var inNum = 0; - var outNum = 0; - if (data['in']) { - inNum = data['in']; - } - if (data['out']) { - outNum = data['out']; - } - viewHtml = viewHtml + getTraverseDivTemplate(kind, inNum, outNum); - } - return viewHtml; -} -*/ - -//remove -/* -function createEdgeInfoView(node) { - var id = node.property.id; - var edgeInfo = node.property.edgeInfo; - var str = ""; - var info = {}; - for (var i=0; i<edgeInfo.length; i++) { - var kind = edgeInfo[i].kind; - var dir = edgeInfo[i].direction; - var num = edgeInfo[i].num; - if (!info[kind]) info[kind] = {}; - info[kind][dir] = num; - } - var viewHTML = createTraverseView(info); - edgeInfo.viewHtml = viewHTML; - $('#traverseDisplayBody')[0].innerHTML = viewHTML; -} -*/ - - /* Twice the top is the same length as the top + buttom */ var EDGEINFO_MARGIN = parseInt($('.edgeInfoDiv').css('margin-top').split('px')[0])*2 + parseInt($('#edgeInfoSample').css('padding-top').split('px')[0])*2 + @@ -300,14 +229,13 @@ var edgeInfoArray = node.property.edgeInfo; for (var i=0; i<edgeInfoArray.length; i++) { var edgeInfo = edgeInfoArray[i]; - console.log(edgeInfo); if (!edgeInfo.view) { - console.log("!edgeInfo.view"); edgeInfo.view = createEdgeInfoDiv(node,edgeInfo); } addEdgeInfoDiv(edgeInfo); } updateEdgeInfoBodyHeight(); + $('#edgeInfoDisplay').css('visibility','visible'); } function init() { @@ -320,14 +248,6 @@ var rootDiv = $('#graphMain'); var rootLeft = rootDiv.offset().left; var rootTop = rootDiv.offset().top; - -//remove -/* - $('#traverseDisplay').css( { - left: rootLeft + 'px', - top: rootTop + 'px' - }); -*/ $('#edgeInfoDisplay').css({ right: 0 + 'px', top: rootTop + 'px' @@ -341,24 +261,11 @@ } function showMiniDisplay(node) { + CURRENT_DATA.nodeId = node.property.id; $("#miniDisplay").css("visibility", "visible"); writeJSONDataToMiniDisplay(node); - CURRENT_DATA.nodeId = node.property.id; } -//remove -/* -function showTraverseDisplay(node) { - CURRENT_DATA.nodeId = node.property.id; - if (!node.property.edgeInfo) { console.log("not found node.edgeInfo "); return; } - if (!node.property.edgeInfo.viewHtml) { - createEdgeInfoView(node); - } - - $('#traverseDisplayBody')[0].innerHTML = node.property.edgeInfo.viewHtml; - $("#traverseDisplay").css("visibility", "visible"); -} -*/ var nodeNum = 0; var OFFSET = 300; var miniD = $('#miniDisplay')[0].style; @@ -411,7 +318,7 @@ function getEvidence(id, kind, direction, edgeInfoId) { $.ajax({ url:"/aat/aaevidencesiftingmodel.userdesktops/get?desktopid="+desktopid() + "&id="+id+"&kind="+kind+"&direction="+direction+"&edgeinfoid="+edgeInfoId, - success:function(o) {console.log(this.url); parseJSONGraphData(GRAPH_DATA, o); recursiveCalcPosition(GRAPH_DATA, GRAPH_DATA.nodes[id]); showEdgesAndNodes(GRAPH_DATA, o, kind);}, + success:function(o) { parseJSONGraphData(GRAPH_DATA, o); recursiveCalcPosition(GRAPH_DATA, GRAPH_DATA.nodes[id]); showEdgesAndNodes(GRAPH_DATA, o, kind);}, type:"GET", cache:true, error:function(o) { console.log("getEvidence error : ", o); } }); @@ -446,38 +353,6 @@ postToServer("id="+node.property.id+"&coordX="+node.position.x+"&coordY="+node.position.y); } -//remove -/* -function traverseAction() { - var inDirChecked = $('#direction_in').is(':checked'); - var outDirChecked = $('#direction_out').is(':checked'); - var labelTags = $('[id=traverseLabel]'); - var kinds = []; - for (var i=0;i<labelTags.length; i++ ) { - var inputTag = labelTags[i].children[0]; - if (inputTag.checked) { - kinds.push(inputTag.value); - } - } - var id = CURRENT_DATA.nodeId; - var edgeInfoArray = GRAPH_DATA.nodes[id].property.edgeInfo; - var edgeInfos = {}; - for (var i=0; i<edgeInfoArray.length; i++) { - var edgeInfo = edgeInfoArray[i]; - var kind = edgeInfo.kind; - if (!edgeInfos[kind]) edgeInfos[kind] = {}; - edgeInfos[kind][edgeInfo.direction] = edgeInfo; - } - for (var i=0; i<kinds.length; i++) { - var kind = kinds[i]; - var edgeInfo = edgeInfos[kind]; - if (inDirChecked && edgeInfo.in) getEvidence(id, kind, "in", edgeInfo.in.id); - if (outDirChecked && edgeInfo.out ) getEvidence(id, kind, "out", edgeInfo.out.id); - } - -} -*/ - function createNodeDiv(node) { node.view = $("<div class='graphNode'/>"); node.view.click(function(){ clickNodeDiv(node.property.id) }); @@ -509,7 +384,7 @@ function(){div.css("box-shadow","");} ); node.view[0].nodeId = node.property.id; - div.click(function(){showMiniDisplay(node);/* showTraverseDisplay(node); //remove */ console.log("showEdgeInfoDisplay"); showEdgeInfoDisplay(node);}); + div.click(function(){showMiniDisplay(node); showEdgeInfoDisplay(node);}); DragHandler.attach($(node.view)[0]); var kindBorder = {agree:"#66a", rejected:"#a66"}; div.css("background", StateColor[node.property.state]||"white"); @@ -695,14 +570,6 @@ jsPlumb.draggable($('.graphNode')); } -var EDGE_LIST = { - evidence:'evidence', - dependency:'dependency', - version:'version', - derived:'derived', - agreement:'agreement' -}; - function recursiveCalcPosition(graphData, parentNode) { if (!parentNode.position) updateNode(parentNode); childNodeIds = getRelationNodeIds(graphData, parentNode); @@ -784,8 +651,6 @@ function beginScript() { DragHandler.attach($('#miniDisplay')[0]); DragHandler.attach($('#edgeInfoDisplay')[0]); -//remove -// DragHandler.attach($('#traverseDisplay')[0]); start(); } @@ -793,5 +658,3 @@ - -