チェンジセット 156 : SPARQLBuilderWWW/web
- 更新日時:
- 2014/09/25 12:27:02 (10 年 前)
- ファイル:
-
- 1 変更
凡例:
- 変更なし
- 追加
- 削除
-
SPARQLBuilderWWW/web/jsgui.html
r151 r156 64 64 65 65 66 var path name= [];66 var pathobj = []; 67 67 var PATHNUM = 0; 68 68 var MAXDEPTH = 0; … … 214 214 215 215 var path = []; 216 pathname = [];216 var pathname = []; 217 217 218 218 if(d.nodeid != 0){ … … 239 239 document.getElementById("selectpath").innerHTML=(resultText); 240 240 241 /* 241 242 if(d.group > (MAXDEPTH - 2)){ 242 243 document.getElementById("getsparqlbutton").style.display = "block"; … … 244 245 document.getElementById("getsparqlbutton").style.display = "none"; 245 246 } 246 247 var xPosition = parseFloat(d3.select(this).attr("cx")) + parseFloat(d3.select(this).style("stroke-width")) + (NODEHEIGHT * 0.5); 248 var yPosition = parseFloat(d3.select(this).attr("cy") - document.getElementById("showpath").offsetHeight + document.getElementById("menu").offsetHeight) + (NODEHEIGHT * 0.5); 249 250 if(xPosition < 0){ 251 xPosition = 0; 252 } 253 if(yPosition < 0){ 254 yPosition = 0; 255 } 256 257 document.getElementById("showpath").style.left = xPosition + "px" 258 document.getElementById("showpath").style.top = yPosition + "px" 259 document.getElementById("showpath").style.display = "block"; 247 */ 248 249 if(d.path == "notend"){ 250 document.getElementById("showpath").style.display = "none"; 251 }else{ 252 253 pathobj = d.path; 254 255 var xPosition = parseFloat(d3.select(this).attr("cx")) + parseFloat(d3.select(this).style("stroke-width")) + (NODEHEIGHT * 0.5); 256 var yPosition = parseFloat(d3.select(this).attr("cy") - document.getElementById("showpath").offsetHeight + document.getElementById("menu").offsetHeight) + (NODEHEIGHT * 0.5); 257 258 if(xPosition < 0){ 259 xPosition = 0; 260 } 261 if(yPosition < 0){ 262 yPosition = 0; 263 } 264 265 document.getElementById("showpath").style.left = xPosition + "px" 266 document.getElementById("showpath").style.top = yPosition + "px" 267 document.getElementById("showpath").style.display = "block"; 268 } 260 269 261 270 }else{ … … 507 516 }) 508 517 .text(function(d){ 509 var nt = d.name; 518 var nodetext = d.name 519 var nodesplit1 = nodetext.split("/"); 520 var nodesplit2 = nodesplit1[nodesplit1.length - 1]; 521 var nodesplit3 = nodesplit2.split("#"); 522 nodetext = nodesplit3[nodesplit3.length - 1]; 510 523 if(d.view == "hide"){ 511 n t = "";512 } 513 return n t;524 nodetext = ""; 525 } 526 return nodetext; 514 527 }); 515 528 … … 574 587 if(i == 0){ 575 588 // 蛻晏屓縺縺代Ν繝シ繝医ヮ繝シ繝峨r繝励ャ繧キ繝・ 576 ret['nodes'].push({'name':obj['paths'][0]['startClassURI'], 'group': 0, 'x':50, 'y':50, 'nodeid':ret['nodes'].length, 'view' : 'no' });589 ret['nodes'].push({'name':obj['paths'][0]['startClassURI'], 'group': 0, 'x':50, 'y':50, 'nodeid':ret['nodes'].length, 'view' : 'no', 'path': 'notend'}); 577 590 } 578 591 // 蜈医↓source縺ォ0�医Ν繝シ繝茨シ峨r莉」蜈・ … … 618 631 if(!isCommonNow){ 619 632 isCommon = false; 620 ret['nodes'].push({'name':obj['paths'][i]['classLinks'][j]['linkedClassURI'], 'group': (j+1), 'x':0, 'y':0, 'dy':0, 'nodeid':ret['nodes'].length, 'view' : 'no' });633 ret['nodes'].push({'name':obj['paths'][i]['classLinks'][j]['linkedClassURI'], 'group': (j+1), 'x':0, 'y':0, 'dy':0, 'nodeid':ret['nodes'].length, 'view' : 'no', 'path': 'notend'}); 621 634 ret['links'].push({'source':source, 'target':ret['nodes'].length - 1, 'value':5, 'property':obj['paths'][i]['classLinks'][j]['propertyURI'], 'view' : 'no'}); 622 635 source = ret['nodes'].length - 1; … … 627 640 628 641 isCommon = false; 629 ret['nodes'].push({'name':obj['paths'][i]['classLinks'][j]['linkedClassURI'], 'group': (j+1), 'x':0, 'y':0, 'dy':0, 'nodeid':ret['nodes'].length, 'view' : 'no' });642 ret['nodes'].push({'name':obj['paths'][i]['classLinks'][j]['linkedClassURI'], 'group': (j+1), 'x':0, 'y':0, 'dy':0, 'nodeid':ret['nodes'].length, 'view' : 'no', 'path': 'notend'}); 630 643 ret['links'].push({'source':source, 'target':ret['nodes'].length - 1, 'value':5, 'property':obj['paths'][i]['classLinks'][j]['propertyURI'], 'view' : 'no'}); 631 644 source = ret['nodes'].length - 1; … … 633 646 // 譌「縺ォ蜈ア騾壹Ν繝シ繝医〒縺ェ縺�↑繧画眠隕剰ソス蜉縺励※谺。縺ク 634 647 }else{ 635 ret['nodes'].push({'name':obj['paths'][i]['classLinks'][j]['linkedClassURI'], 'group': (j+1), 'x':0, 'y':0, 'dy':0, 'nodeid':ret['nodes'].length, 'view' : 'no' });648 ret['nodes'].push({'name':obj['paths'][i]['classLinks'][j]['linkedClassURI'], 'group': (j+1), 'x':0, 'y':0, 'dy':0, 'nodeid':ret['nodes'].length, 'view' : 'no', 'path': 'notend'}); 636 649 ret['links'].push({'source':source, 'target':ret['nodes'].length - 1, 'value':5, 'property':obj['paths'][i]['classLinks'][j]['propertyURI'], 'view' : 'no'}); 637 650 source = ret['nodes'].length - 1; … … 639 652 640 653 } 654 ret['nodes'][ret['nodes'].length - 1]['path'] = obj['paths'][i]; 641 655 PATHNUM++; 642 656 } … … 814 828 function getSPARQL(){ 815 829 816 var selectpath = JSON.stringify(pathname); 830 var selectpath = JSON.stringify(pathobj); 831 817 832 //document.getElementById("selectpath").innerHTML=(resultText); 818 833