チェンジセット 225 : SPARQLBuilderWWW/web
- 更新日時:
- 2014/12/25 17:45:48 (10 年 前)
- パス:
- SPARQLBuilderWWW/web
- ファイル:
-
- 2 変更
凡例:
- 変更なし
- 追加
- 削除
-
SPARQLBuilderWWW/web/dist.html
r224 r225 10 10 <!-- script src="./sb-test.js"></script --> 11 11 <script> 12 <!-- 12 <!-- 13 13 function sendSPARQL(){ 14 14 var ep = $("*[name=selectendpoint]").val(); … … 29 29 function trySample(sparql){ 30 30 var sb = new SPARQLBuilder('sparql'); 31 32 $(document).on('complete', '#EndPointSelect', function(){ 31 sb.loadSamplePathList(); 32 33 $('#seclass').on('epcomplete', function(){ 33 34 $('#EndPointSelect').val('http://www.ebi.ac.uk/rdf/services/reactome/sparql'); 34 35 sb.changeEndPoint(); 35 36 }); 36 37 $( document).on('complete', '#StartClassSelect', function(){37 38 $('#seclass').on('secomplete', function(){ 38 39 $('#StartClassSelect').val('http://www.biopax.org/release/biopax-level3.owl#Protein'); 39 sb.startClass = 'http://www.biopax.org/release/biopax-level3.owl#Protein';40 40 $('#EndClassSelect').val('http://www.biopax.org/release/biopax-level3.owl#Pathway'); 41 sb.endClass = 'http://www.biopax.org/release/biopax-level3.owl#Pathway';42 sb.loadPathList();43 41 }); 44 42 } -
SPARQLBuilderWWW/web/sparqlbuilder.js
r222 r225 88 88 $("#EndPointSelect").append('<option value="' + list[i] + '">' + list[i] + '</option>'); 89 89 } 90 $("# EndPointSelect").trigger(event);90 $("#seclass").trigger(new $.Event('epcomplete')); 91 91 }, 92 92 }); … … 111 111 $("#EndClassSelect").append('<option value="' + list[i]['uri'] + '">' + list[i]['label'] + ' (' + list[i]['number'] + ')' + '</option>'); 112 112 } 113 $("#StartClassSelect").trigger(event) 114 $("#EndClassSelect").trigger(event) 113 $("#seclass").trigger(new $.Event('secomplete')); 115 114 } 116 115 }); 116 }; 117 118 SPARQLBuilder.prototype.loadSamplePathList = function() { 119 var url = "http://www.sparqlbuilder.org/api/plist?ep=" + encodeURIComponent('http://www.ebi.ac.uk/rdf/services/reactome/sparql') 120 + "&startclass=" + encodeURIComponent('http://www.biopax.org/release/biopax-level3.owl#Protein') 121 + "&endclass=" + encodeURIComponent('http://www.biopax.org/release/biopax-level3.owl#Pathway'); 122 //var url = "http://localhost:8080/api/plist?ep=" + encodeURIComponent(this.endpoint) 123 // + "&startclass=" + encodeURIComponent(startclass) 124 // + "&endclass=" + encodeURIComponent(endclass); 125 var self = this; 126 self.loadIcon("view"); 127 setTimeout(function(){ 128 129 $.ajax({ 130 type : "GET", 131 url : url, 132 async : false, 133 timeout : 1000000, 134 success : function(data) { 135 var width = $(".SparqlBuilderContent").width(); 136 self.drawGraph = new SPARQLBuilderDrawGraph(data, width, 10); 137 self.loadIcon("hide"); 138 self.drawGraph.view_map(); 139 $('select[name="selectendpoint"]').val('http://www.ebi.ac.uk/rdf/services/reactome/sparql'); 140 }, 141 error: function(data){ 142 self.loadIcon("hide"); 143 alert("error: ", data); 144 } 145 }); 146 }, 100) 117 147 }; 118 148 … … 184 214 this.pathlimit = pathlimit; 185 215 this.pathobj = null; 186 this.NODEHEIGHT = 50;187 this.MOUSEMOVED = 0;188 216 }; 189 217 … … 196 224 // make_data繝。繧ス繝�ラ縺ョ邨先棡繧貞叙蠕� 197 225 var json = this.make_data(0); 198 199 // SVG縺悟ュ伜惠縺吶k縺ェ繧峨�蜑企勁200 if (d3.select("#sparqlBuilderGraph").select("svg")) {201 d3.select("#sparqlBuidlerGraph").select("svg").remove();202 }203 226 204 227 if(json['nodes'].length != 0){ … … 214 237 var color = d3.scale.category20(); 215 238 239 // SVG縺ョ蜑企勁 240 d3.select("#sparqlBuilderGraph").html(""); 216 241 // 逕サ髱「繧オ繧、繧コ縺ォ蜷医o縺婀VG縺ョ霑ス蜉 217 242 var svg = d3.select("#sparqlBuilderGraph").append("svg") … … 272 297 .style("text-anchor", function(d) { return 'middle'; }); 273 298 299 // 繝槭え繧ケ縺ョ蜍輔″繧ォ繧ヲ繝ウ繝医r繝ォ繝シ繝医↓謖√◆縺帙k 300 node.data()[0].mousemoved = 0; 301 274 302 // 繝弱�繝峨∈縺ョ繧ェ繝ウ繝槭え繧ケ縺ァ繝代せ謗「邏「縲√ヱ繧ケ荳ュ縺ョ繝ェ繝ウ繧ッ譁�ュ励r陦ィ遉コ 275 303 var self = this; … … 277 305 278 306 // 繝槭え繧ケ縺ョ蜍輔″繧ォ繧ヲ繝ウ繝医r繝ェ繧サ繝�ヨ 279 this.MOUSEMOVED= 0;307 node.data()[0].mousemoved = 0; 280 308 281 309 // 陦ィ遉コ縺吶k繝代せ菫晏ュ倡畑驟榊� … … 701 729 bg.on("mousemove", function(){ 702 730 // MOUSEMOVED繧定ソス蜉�医ヮ繝シ繝峨↓繧ェ繝ウ繝槭え繧ケ縺輔l繧句コヲ縺ォ繧ォ繧ヲ繝ウ繝医Μ繧サ繝�ヨ�� 703 this.MOUSEMOVED++;731 node.data()[0].mousemoved++; 704 732 // 30繧定カ�∴縺溘i 705 if( this.MOUSEMOVED> 30){733 if(node.data()[0].mousemoved > 30){ 706 734 // 繝��繝ォ繝√ャ繝励r髱櫁。ィ遉コ縺ォ縺励※繧ォ繧ヲ繝ウ繝医Μ繧サ繝�ヨ 707 735 document.getElementById("sparqlBuilderShowpath").style.display = "none"; 708 this.MOUSEMOVED= 0;736 node.data()[0].mousemoved = 0; 709 737 } 710 738 }); … … 727 755 this.MAXDEPTH = 0; 728 756 this.TREESPACE = 0; 757 this.NODEHEIGHT = 50; 729 758 this.DRAWHEIGHT = this.NODEHEIGHT; 730 759