diff options
author | nodiscc <nodiscc@gmail.com> | 2014-12-29 03:00:25 +0100 |
---|---|---|
committer | nodiscc <nodiscc@gmail.com> | 2014-12-29 03:00:25 +0100 |
commit | f8d83b35b634c82b47f9995632f96d47fd5d883b (patch) | |
tree | b99731934b0a3b735ea8b810e6685f801448a66b /index.php | |
parent | 3259f1a81479ea24cc25e34529f4bafc655dbd0d (diff) | |
parent | 1e3b2740e522a8fde6bfef1030cd9b4a5eae0304 (diff) | |
download | Shaarli-f8d83b35b634c82b47f9995632f96d47fd5d883b.tar.gz Shaarli-f8d83b35b634c82b47f9995632f96d47fd5d883b.tar.zst Shaarli-f8d83b35b634c82b47f9995632f96d47fd5d883b.zip |
Merge pull request #85 from nodiscc/tagcloud-scaling
improve tag cloud font size scaling
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1252,8 +1252,9 @@ function renderPage() | |||
1252 | ksort($tags); | 1252 | ksort($tags); |
1253 | $tagList=array(); | 1253 | $tagList=array(); |
1254 | foreach($tags as $key=>$value) | 1254 | foreach($tags as $key=>$value) |
1255 | // Tag font size scaling: default 15 and 30 logarithm bases affect scaling, 22 and 6 are arbitrary font sizes for max and min sizes. | ||
1255 | { | 1256 | { |
1256 | $tagList[$key] = array('count'=>$value,'size'=>max(40*$value/$maxcount,8)); | 1257 | $tagList[$key] = array('count'=>$value,'size'=>log($value, 15) / log($maxcount, 30) * (22-6) + 6); |
1257 | } | 1258 | } |
1258 | $PAGE = new pageBuilder; | 1259 | $PAGE = new pageBuilder; |
1259 | $PAGE->assign('linkcount',count($LINKSDB)); | 1260 | $PAGE->assign('linkcount',count($LINKSDB)); |