什么是公式来计算字体大小,标签在tagcloud?字体大小、公式、标签、tagcloud

由网友(冷小汐)分享简介:我有一个标签云,我需要知道我怎么可以改变字体大小,最常用的标签。I have a tag cloud and I need to know how can I change the font-size for the most used tags.我需要设置最小字体大小和最大值,字体大小。I need to se...

我有一个标签云,我需要知道我怎么可以改变字体大小,最常用的标签。

I have a tag cloud and I need to know how can I change the font-size for the most used tags.

我需要设置最小字体大小和最大值,字体大小。

I need to set a min-font-size and a max-font-size.

推荐答案

您可以使用与某些标签相对于所述最大标签的相关项目的数量的线性或对数评估,由最小值和最大值之间的差乘以它字体大小,然后将其添加到最小字体大小。例如,在伪code中的数学可能是:

You could use a linear or logarithmic assessment of the number of items associated with a certain tag relative to the largest tag, multiply it by the difference between minimum and maximum font sizes, then add it to the minimum font size. For example, the math in pseudocode might be:

let min = 12, max = 24
for each tag
    font = (items / items in biggest tag) * (max - min) + min
阅读全文

相关推荐

最新文章