Commit 95c34810 authored by PkSM3's avatar PkSM3

click in country OK

parent 36bd56e1
...@@ -62,6 +62,35 @@ function callGeomap(){ ...@@ -62,6 +62,35 @@ function callGeomap(){
// $("#CurrentView").hide(); // $("#CurrentView").hide();
} }
function clickInCountry( CC ) {
pr("in extras.js: you've clicked "+CC)
var results = []
for(var i in Nodes) {
if( !isUndef(Nodes[i].CC) && Nodes[i].CC==CC) results.push(i)
}
$.doTimeout(20,function (){
if(swclickActual=="social") {
MultipleSelection(results);
return;
}
if(swclickActual=="semantic") {
var oposresults = getNeighs2( results , bipartiteD2N );
MultipleSelection(oposresults);
return;
}
});
}
function callTWJS(){ function callTWJS(){
// db=getCurrentDBforCurrentGexf(); // db=getCurrentDBforCurrentGexf();
// db=JSON.stringify(db); // db=JSON.stringify(db);
......
...@@ -91,11 +91,12 @@ function initiateMap(db,query,submodName){ ...@@ -91,11 +91,12 @@ function initiateMap(db,query,submodName){
}, },
eventHandlers: { eventHandlers: {
dblclick: function(e, id, mapElem, textElem) { dblclick: function(e, id, mapElem, textElem) {
console.log(id); if(mapElem.originalAttrs.fill!="#FFFFFF") {
console.log(partialGraph) $.doTimeout(200,function (){
$.doTimeout(30,function (){ $("#closegeomap").click();
$("#closegeomap").click(); clickInCountry(id);
}); });
}
} }
} }
}, },
......
...@@ -27,9 +27,9 @@ echo "sqlite:" .$mainpath.$db."\n"; ...@@ -27,9 +27,9 @@ echo "sqlite:" .$mainpath.$db."\n";
echo "sqlite:" ."../../community.db"; echo "sqlite:" ."../../community.db";
//$dbname=$db[0];//getDB($mainpath);//'homework-20750-1-homework-db.db';; //$dbname=$db[0];//getDB($mainpath);//'homework-20750-1-homework-db.db';;
$base = new PDO("sqlite:" ."/var/www/adasd/community.db"); $base = new PDO("sqlite:" .$db);
echo "succeed?\n"; echo "succeed\n";
$max_item_displayed=6; $max_item_displayed=6;
......
...@@ -10,10 +10,12 @@ foreach($db as $d){ ...@@ -10,10 +10,12 @@ foreach($db as $d){
break; break;
} }
} }
if($mainpath=="//") $mainpath=""; if($mainpath=="//") $mainpath="";
if ( is_array($db) ) $db = $db[0];
//$dbname=$db[0];//getDB($mainpath);//'homework-20750-1-homework-db.db';; //$dbname=$db[0];//getDB($mainpath);//'homework-20750-1-homework-db.db';;
$base = new PDO("sqlite:" .$mainpath.$db) or die("cannot open the database"); $base = new PDO("sqlite:" .$mainpath.$db);
$max_item_displayed=6; $max_item_displayed=6;
......
...@@ -153,6 +153,23 @@ function getNeighs(sels,arr){ ...@@ -153,6 +153,23 @@ function getNeighs(sels,arr){
}//It returns an array not a dict! }//It returns an array not a dict!
//Using bipartiteN2D or bipartiteD2N
//This receives an array not a dict!
function getNeighs2(sels,arr){
neighDict={};
for(var i in sels) {
id = sels[i]
if(!isUndef(arr[id])) {
A=arr[id].neighbours;
for(var j in A){
neighDict[A[j]]=1
}
// neighDict[id]=1;
}
}
return Object.keys(neighDict);
}//It returns an array not a dict!
//to general utils //to general utils
function getArrSubkeys(arr,id) { function getArrSubkeys(arr,id) {
var result = [] var result = []
......
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