Commit 3bcc2454 authored by PkSM3's avatar PkSM3

geomap bugfix: labels

parent 651b18db
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
function callGeomap(){ function callGeomap(){
db=JSON.stringify('php/community.db'); db=JSON.stringify('php/community.db');
if(is_empty(selections)){ if(is_empty(selections)){
jsonparams='["all"]'; jsonparams=JSON.stringify(Object.keys(getnodesIndex()));
// pr( Object.keys(getnodesIndex()) )
} else { } else {
N=0; N=0;
...@@ -25,7 +26,7 @@ function callGeomap(){ ...@@ -25,7 +26,7 @@ function callGeomap(){
temp=getNeighs(selections,arr); temp=getNeighs(selections,arr);
sel_plus_neigh=Object.keys(temp); sel_plus_neigh=Object.keys(temp);
k=sel_plus_neigh.length; k=sel_plus_neigh.length;
if(N==k) jsonparams='["all"]'; if(N==k) jsonparams=JSON.stringify(Object.keys(getnodesIndex()));
else jsonparams=JSON.stringify(sel_plus_neigh); else jsonparams=JSON.stringify(sel_plus_neigh);
//jsonparams=JSON.stringify(getSelections()); //jsonparams=JSON.stringify(getSelections());
......
.geomapCont { .geomapCont {
margin:auto; margin:auto;
width:90%; width:80%;
text-align:center; text-align:center;
white-space: nowrap; white-space: nowrap;
} }
......
...@@ -115,7 +115,7 @@ if($selectiveQuery){ ...@@ -115,7 +115,7 @@ if($selectiveQuery){
$info["attrs"] = array(); $info["attrs"] = array();
$info["attrs"]["href"] = "#"; $info["attrs"]["href"] = "#";
$info["tooltip"] = array(); $info["tooltip"] = array();
//$info["tooltip"]["content"] = "<span style='font-weight=bold;'>" . $CC[$key] . "</span><br/>" . $realOCC.' '.$pluralnick.' ('.$info["percentage"].'%)'; //$info["tooltip"]["content"] = "<span style='font-weight:bold;'>" . $CC[$key] . "</span><br/>" . $realOCC.' '.$pluralnick.' ('.$info["percentage"].'%)';
$norm_country[$key] = $info; $norm_country[$key] = $info;
if($percentage>$maxF) $maxF=$percentage; if($percentage>$maxF) $maxF=$percentage;
...@@ -135,7 +135,7 @@ if($selectiveQuery){ ...@@ -135,7 +135,7 @@ if($selectiveQuery){
$old=$value["percentage"]; $old=$value["percentage"];
$new=$old*$constant;# da formula! $new=$old*$constant;# da formula!
$norm_country[$key]["percentage"]=round($new,2); $norm_country[$key]["percentage"]=round($new,2);
$norm_country[$key]["tooltip"]["content"]= "<span style='font-weight=bold;'>" . $CC[$key] . "</span><br/>" . $value["realValue"].' '.$pluralnick.' ('.round($new,2).'%)'; $norm_country[$key]["tooltip"]["content"]= "<span style='font-weight:bold;'>" . $CC[$key] . "</span><br/>" . $value["realValue"].' '.$pluralnick.' ('.round($new,2).'%)';
//pr($value["code"].": ".$value["realValue"].", ".$value["percentage"].", div:".($country_divisor[$key]+1)); //pr($value["code"].": ".$value["realValue"].", ".$value["percentage"].", div:".($country_divisor[$key]+1));
} }
} else { } else {
...@@ -150,7 +150,7 @@ if($selectiveQuery){ ...@@ -150,7 +150,7 @@ if($selectiveQuery){
$tempcount = 0; $tempcount = 0;
if ($norm_country[$code]) { if ($norm_country[$code]) {
$norm_country[$code]["value"]+=$row["count(*)"]; $norm_country[$code]["value"]+=$row["count(*)"];
$norm_country[$code]["tooltip"]["content"] = "<span style='font-weight=bold;'>" . $CC[$code] . "</span><br/>" . $norm_country[$code]["value"].' '.$pluralnick; $norm_country[$code]["tooltip"]["content"] = "<span style='font-weight:bold;'>" . $CC[$code] . "</span><br/>" . $norm_country[$code]["value"].' '.$pluralnick;
} else { } else {
$info = array(); $info = array();
$info["code"] = $code; $info["code"] = $code;
...@@ -158,7 +158,7 @@ if($selectiveQuery){ ...@@ -158,7 +158,7 @@ if($selectiveQuery){
$info["attrs"] = array(); $info["attrs"] = array();
$info["attrs"]["href"] = "#"; $info["attrs"]["href"] = "#";
$info["tooltip"] = array(); $info["tooltip"] = array();
$info["tooltip"]["content"] = "<span style='font-weight=bold;'>" . $CC[$code] . "</span><br/>" . $row["count(*)"].' '.$pluralnick; $info["tooltip"]["content"] = "<span style='font-weight:bold;'>" . $CC[$code] . "</span><br/>" . $row["count(*)"].' '.$pluralnick;
$norm_country[$code] = $info; $norm_country[$code] = $info;
} }
} }
...@@ -223,12 +223,12 @@ foreach ($temp as $key => $value) { ...@@ -223,12 +223,12 @@ foreach ($temp as $key => $value) {
$moreinfo["tooltip"] = array(); $moreinfo["tooltip"] = array();
if($selectiveQuery){ if($selectiveQuery){
if($norm_country[$j]["realValue"]==1){ if($norm_country[$j]["realValue"]==1){
$moreinfo["tooltip"]["content"] = "<span style='font-weight=bold;'>" . $CC[$j] . "</span><br/>" . $norm_country[$j]["realValue"]. ' '.$pluralnick.' ('.$norm_country[$j]["percentage"].'%)'; $moreinfo["tooltip"]["content"] = "<span style='font-weight:bold;'>" . $CC[$j] . "</span><br/>" . $norm_country[$j]["realValue"]. ' '.$pluralnick.' ('.$norm_country[$j]["percentage"].'%)';
} else { } else {
$moreinfo["tooltip"]["content"] = "<span style='font-weight=bold;'>" . $CC[$j] . "</span><br/>" . $norm_country[$j]["realValue"]. ' '.$pluralnick.' ('.$norm_country[$j]["percentage"].'%)'; $moreinfo["tooltip"]["content"] = "<span style='font-weight:bold;'>" . $CC[$j] . "</span><br/>" . $norm_country[$j]["realValue"]. ' '.$pluralnick.' ('.$norm_country[$j]["percentage"].'%)';
} }
} else { } else {
$moreinfo["tooltip"]["content"] = "<span style='font-weight=bold;'>" . $CC[$j] . "</span><br/>" . $value["occ"]. ' '.$pluralnick; $moreinfo["tooltip"]["content"] = "<span style='font-weight:bold;'>" . $CC[$j] . "</span><br/>" . $value["occ"]. ' '.$pluralnick;
} }
$thedata[$j] = $moreinfo; $thedata[$j] = $moreinfo;
} }
......
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