Commit 31d29953 authored by pksm3's avatar pksm3

everything set i think

parent 1e49df00
......@@ -102,6 +102,7 @@
<div id="graphid" style="visibility: hidden;">./graph.json</div>
</a>
</li>
<!--
<li>
<a>
......@@ -156,7 +157,7 @@
<input id="searchinput" autocomplete="off" class="form-control input-sm col-lg-8" placeholder="Search" type="text">
</a></li>
</ul>
<!--
<ul id="colorGraph" class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
......@@ -171,6 +172,7 @@
</ul>
</li>
</ul>
-->
......@@ -221,12 +223,13 @@
<a href="#" id="aUnfold" class="rightarrow"></a>
</div>
</li>
<!--
<li>
<a href="#" id="geomapicon" onclick="$('#geomapmodal').modal('show'); callGeomap();">
<img title="World Map Distribution" width="34px" src="libs/img2/world.png"></img>
</a>
</li>
-->
<li>
......@@ -358,7 +361,7 @@
<div class="geomapCont"></div>
</div>
<!-- </div> -->
<!-- <div class="geomapCont"></div> -->
<!-- <div class="geomapCont"></div> -->
<div id="closegeomap" data-dismiss="modal"></div>
</div>
......@@ -368,6 +371,8 @@
<script src="libs/jquery/jquery.mousewheel.min.js" type="text/javascript"></script>
<script type="text/javascript" src="libs/freshslider.1.0.js"></script>
<script src="libs/readmore.js" type="text/javascript"></script>
<script src="libs/jquery/jquery.easytabs.min.js" type="text/javascript"></script>
<script src="libs/bootstrap/js/bootstrap.min.js"></script>
<!--<script src="libs/bootswatch/js/bootswatch.js"></script>-->
......@@ -393,6 +398,9 @@
<script src="tinawebJS/main.js" type="text/javascript" language="javascript"></script>
<script type="text/javascript">
$('#tab-container').easytabs({updateHash:false});
</script>
......
/*
* Customize as you want ;)
*/
function newPopup(url) {
popupWindow = window.open(url,'popUpWindow','height=700,width=800,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=no')
}
function callGeomap(){
db=JSON.stringify('community.db');
if(is_empty(selections)){
......@@ -157,20 +162,22 @@ function getTopPapers(type){
dbsPaths=JSON.stringify(dbsPaths);
thisgexf=JSON.stringify(decodeURIComponent(getUrlParam.file));
image='<img style="display:block; margin: 0px auto;" src="'+twjs+'img/ajax-loader.gif"></img>';
$("#topPapers").show();
$("#topPapers").html(image);
bi=(Object.keys(categories).length==2)?1:0;
$.ajax({
type: 'GET',
url: twjs+'php/info_div.php',
url: 'php/info_div.php',
data: "type="+type+"&bi="+bi+"&query="+jsonparams+"&dbs="+dbsPaths+"&gexf="+thisgexf,
//contentType: "application/json",
//dataType: 'json',
success : function(data){
pr(twjs+'php/info_div.php?'+"type="+type+"&bi="+bi+"&query="+jsonparams+"&dbs="+dbsPaths+"&gexf="+thisgexf);
pr('php/info_div.php?'+"type="+type+"&bi="+bi+"&query="+jsonparams+"&dbs="+dbsPaths+"&gexf="+thisgexf);
$("#topPapers").html(data);
$("#topPapers").show();
},
error: function(){
pr('Page Not found: updateLeftPanel_uni()');
pr('Page Not found: getTopPapers()');
}
});
}
......@@ -303,6 +310,7 @@ function getTips(){
"<li>To explore the neighborhood of a selection, either double click on the selected nodes, either click on the macro/meso level button. Zoom out in meso view return to macro view.</li>"+
"<li>Click on the 'all nodes' tab below to view the full clickable list of nodes.</li>"+
"</ul>";
$("#tab-container").hide();
return text;
}
......
......@@ -357,7 +357,7 @@ function NodeWeightFilter(sliderDivID , type_attrb , type , criteria) {
$(sliderDivID).freshslider({
range: true,
step:1,
value:[10, 60],
value:[10, 70],
enabled: false,
onchange:function(low, high){
console.log(low, high);
......@@ -378,7 +378,7 @@ function NodeWeightFilter(sliderDivID , type_attrb , type , criteria) {
step: 1,
min:0,
max:steps-1,
bgcolor:(type_attrb=="Document")?"#27c470":"#FFA500" ,
bgcolor:(type=="Document")?"#27c470":"#FFA500" ,
value:[0,steps-1],
onchange:function(low, high){
var filtervalue = low+"-"+high
......
......@@ -112,6 +112,13 @@ function bringTheNoise(pathfile,type){
body.style.paddingTop=$("#dafixedtop").height()+"px";
$('.etabs').click(function(){
$.doTimeout(500,function (){
$("#opossiteNodes").readmore({maxHeight:200});
$("#sameNodes").readmore({maxHeight:200});
});
});
$("#changetype").click(function(){
pr("")
pr(" ############ changeTYPE click");
......@@ -119,6 +126,9 @@ function bringTheNoise(pathfile,type){
changeType();
$.doTimeout(500,function (){
$('.etabs a[href="#tabs1"]').trigger('click');
});
printStates()
pr(" ############ / changeTYPE click");
......@@ -204,8 +214,8 @@ function bringTheNoise(pathfile,type){
parse(decodeURIComponent(pathfile));
if(type=="mono") {
$("#changetype").hide();
$("#changetype").hide();
if( pathfile.indexOf(".json") > -1 ) {
JSONFile( pathfile )
......@@ -214,6 +224,12 @@ function bringTheNoise(pathfile,type){
}
pushSWClick("social");
$("#taboppos").remove();
$.doTimeout(500,function (){
$('.etabs a[href="#tabs2"]').trigger('click');
});
pr(partialGraph._core.graph.nodes.length)
pr(partialGraph._core.graph.edges.length)
}
......@@ -597,22 +613,13 @@ function theListeners(){
// finished but not used
// NodeWeightFilter ( "#sliderANodeWeight" , "Document" , "type" , "size")
$("#sliderANodeWeight").freshslider({
range: true,
step:1,
value:[10, 60],
enabled: false,
onchange:function(low, high){
console.log(low, high);
}
});
// i've to put a timeout, idkwhy
$.doTimeout(100,function (){
NodeWeightFilter ( "#sliderANodeWeight" , "type" , "Document" , "size")
// finished
//this should be available at start!!
// pr("applying edge weith filter")
EdgeWeightFilter("#sliderAEdgeWeight", "label" , "nodes1", "weight");
EdgeWeightFilter("#sliderAEdgeWeight", "label" , "nodes1", "weight");
});
//finished
......
......@@ -30,7 +30,7 @@ function cancelSelection (fromTagCloud) {
if(fromTagCloud==false){
$("#names").html("");
$("#topPapers").html(""); $("#topPapers").hide();
$("#opossiteNodes").html("");
$("#opossiteNodes").html(""); $("#tab-container").hide();
$("#information").html("");
$("#searchinput").val("");
$("#switchbutton").hide();
......@@ -353,6 +353,30 @@ function htmlfied_alternodes(elems) {
return oppositesNodes
}
function manualForceLabel(nodeid,active) {
// pr("manual|"+nodeid+"|"+active)
partialGraph._core.graph.nodesIndex[nodeid].active=active;
partialGraph.draw();
}
function htmlfied_samenodes(elems) {
var sameNodes=[]
js1=' onmouseover="manualForceLabel(this.id,true);" ';
js2=' onmouseout="manualForceLabel(this.id,true);" ';
if(elems.length>0) {
var A = getVisibleNodes()
for (var a in A){
n = A[a]
if(!n.active && n.color.charAt(0)=="#" ) {
sameNodes.push('<li onmouseover="manualForceLabel(\''+n.id+'\',true)" onmouseout="manualForceLabel(\''+n.id+'\',false)" >'+ n.label+ '</li>')
}
}
}
return sameNodes
}
// nodes information div
function htmlfied_nodesatts(elems){
......@@ -386,9 +410,9 @@ function htmlfied_nodesatts(elems){
if(node.type==catSem){
information += '<li><b>' + node.label + '</b></li>';
google='<a href=http://www.google.com/#hl=en&source=hp&q=%20'+node.label.replace(" ","+")+'%20><img src="'+twjs+'img/google.png"></img></a>';
wiki = '<a href=http://en.wikipedia.org/wiki/'+node.label.replace(" ","_")+'><img src="'+twjs+'img/wikipedia.png"></img></a>';
flickr= '<a href=http://www.flickr.com/search/?w=all&q='+node.label.replace(" ","+")+'><img src="'+twjs+'img/flickr.png"></img></a>';
google='<a href=http://www.google.com/#hl=en&source=hp&q=%20'+node.label.replace(" ","+")+'%20><img src="'+'img/google.png"></img></a>';
wiki = '<a href=http://en.wikipedia.org/wiki/'+node.label.replace(" ","_")+'><img src="'+'img/wikipedia.png"></img></a>';
flickr= '<a href=http://www.flickr.com/search/?w=all&q='+node.label.replace(" ","+")+'><img src="'+'img/flickr.png"></img></a>';
information += '<li>'+google+"&nbsp;"+wiki+"&nbsp;"+flickr+'</li><br>';
semnodes.push(information)
}
......@@ -418,17 +442,28 @@ function updateLeftPanel_fix() {
alterNodesDIV+= '</div>';
}
sameNodesDIV = "";
sameNodesDIV+='<div id="sameNodes"><ul style="list-style: none;">';//tagcloud
sameNodesDIV += htmlfied_samenodes( getNodeIDs(selections) ).join("\n") ;
sameNodesDIV+= '</ul></div>';
// getTopPapers("semantic");
informationDIV += '<br><h4>Information:</h4><ul>';
informationDIV += htmlfied_nodesatts( getNodeIDs(selections) ).join("<br>\n")
informationDIV += '</ul><br>';
$("#names").html(namesDIV);
$("#opossiteNodes").html(alterNodesDIV);
$("#names").html(namesDIV).readmore({maxHeight:100});
$("#tab-container").show();
$("#opossiteNodes").html(alterNodesDIV).readmore({maxHeight:200});
$("#sameNodes").html(sameNodesDIV).readmore({maxHeight:200});
$("#information").html(informationDIV);
$("#tips").html("");
$.doTimeout(30,function (){
$("#tips").html("");
});
// $("#topPapers").show();
if(categoriesIndex.length==1) getTopPapers("semantic");
else getTopPapers(swclickActual);
}
function printStates() {
......@@ -574,7 +609,6 @@ function markAsSelected(n_id,sel) {
nodeSel.attr['grey'] = 0;
if(categoriesIndex.length==1) {
pr("jeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeere")
if( !isUndef(nodes1[nodeSel.id]) &&
!isUndef(nodes1[nodeSel.id].neighbours)
){
......@@ -582,17 +616,19 @@ function markAsSelected(n_id,sel) {
for(var i in neigh){
vec = partialGraph._core.graph.nodesIndex[neigh[i]];
vec.color = vec.attr['true_color'];
vec.attr['grey'] = 0;
an_edge=partialGraph._core.graph.edgesIndex[vec.id+";"+nodeSel.id];
if(!isUndef(an_edge) && !an_edge.hidden){
an_edge.color = an_edge.attr['true_color'];
an_edge.attr['grey'] = 0;
}
an_edge=partialGraph._core.graph.edgesIndex[nodeSel.id+";"+vec.id];
if(!isUndef(an_edge) && !an_edge.hidden){
an_edge.color = an_edge.attr['true_color'];
an_edge.attr['grey'] = 0;
if(vec) {
vec.color = vec.attr['true_color'];
vec.attr['grey'] = 0;
an_edge=partialGraph._core.graph.edgesIndex[vec.id+";"+nodeSel.id];
if(!isUndef(an_edge) && !an_edge.hidden){
an_edge.color = an_edge.attr['true_color'];
an_edge.attr['grey'] = 0;
}
an_edge=partialGraph._core.graph.edgesIndex[nodeSel.id+";"+vec.id];
if(!isUndef(an_edge) && !an_edge.hidden){
an_edge.color = an_edge.attr['true_color'];
an_edge.attr['grey'] = 0;
}
}
}
}
......@@ -1583,9 +1619,9 @@ function changeToMeso(iwannagraph) {
socsemFlag=true;
}
// EdgeWeightFilter("#sliderBEdgeWeight", "label" , "nodes2", "weight");
// NodeWeightFilter ( "#sliderBNodeWeight" , "type" , "NGram" , "size")
// EdgeWeightFilter("#sliderAEdgeWeight", "label" , "nodes1", "weight");
$("#category-B").show();
EdgeWeightFilter("#sliderBEdgeWeight", "label" , "nodes2", "weight");
NodeWeightFilter ( "#sliderBNodeWeight" , "type", "NGram" , "size");
$("#colorGraph").hide();
}
......@@ -1691,6 +1727,9 @@ function changeToMeso(iwannagraph) {
}
}
$("#category-B").show();
EdgeWeightFilter("#sliderBEdgeWeight", "label" , "nodes2", "weight");
NodeWeightFilter ( "#sliderBNodeWeight" , "type" , "NGram" , "size");
// EdgeWeightFilter("#sliderBEdgeWeight", "label" , "nodes2", "weight");
// NodeWeightFilter ( "#sliderBNodeWeight" , "type" , "NGram" , "size")
$("#colorGraph").hide();
......@@ -1737,6 +1776,11 @@ function changeToMacro(iwannagraph) {
createEdgesForExistingNodes(iwannagraph);
if(iwannagraph=="social") showMeSomeLabels(6);
else {
$("#category-B").show();
EdgeWeightFilter("#sliderBEdgeWeight", "label" , "nodes2", "weight");
NodeWeightFilter ( "#sliderBNodeWeight" , "type" , "NGram" , "size");
}
swMacro=true;
if (!is_empty(selections))
......
......@@ -627,11 +627,7 @@ function JSONFile( URL ) {
contentType: "application/json",
async: true,
success : function(data) {
pr("nodes:")
pr(data.nodes)
pr("---------")
pr("links: ")
pr(data.links)
if(!isUndef(getUrlParam.seed))seed=getUrlParam.seed;
parseSimpleJSON(data,seed)
......@@ -682,7 +678,7 @@ function parseSimpleJSON( data , seed ) {
htmlCont:"",
color:color
}); // The graph node
pr(node)
Nodes[i] = node;
partialGraph.addNode( i , node );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment