Merge pull request #85 from nodiscc/tagcloud-scaling

improve tag cloud font size scaling
This commit is contained in:
nodiscc 2014-12-29 03:00:25 +01:00
commit f8d83b35b6
2 changed files with 2 additions and 2 deletions

View file

@ -562,7 +562,6 @@ a.qrcode img {
} }
#cloudtag a { #cloudtag a {
font-weight:bold;
color: black; color: black;
text-decoration: none; text-decoration: none;
} }

View file

@ -1252,8 +1252,9 @@ function renderPage()
ksort($tags); ksort($tags);
$tagList=array(); $tagList=array();
foreach($tags as $key=>$value) foreach($tags as $key=>$value)
// Tag font size scaling: default 15 and 30 logarithm bases affect scaling, 22 and 6 are arbitrary font sizes for max and min sizes.
{ {
$tagList[$key] = array('count'=>$value,'size'=>max(40*$value/$maxcount,8)); $tagList[$key] = array('count'=>$value,'size'=>log($value, 15) / log($maxcount, 30) * (22-6) + 6);
} }
$PAGE = new pageBuilder; $PAGE = new pageBuilder;
$PAGE->assign('linkcount',count($LINKSDB)); $PAGE->assign('linkcount',count($LINKSDB));