]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - index.php
improve tag cloud font size scaling
[github/shaarli/Shaarli.git] / index.php
index 02a6725f918767b8164e91f2d5aa5a877d35a0c5..7843f2b8ede24f83b02bce9f7d090c3361ad6f48 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1251,8 +1251,9 @@ function renderPage()
         ksort($tags);
         $tagList=array();
         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->assign('linkcount',count($LINKSDB));