tagclouds或tagCloud逻辑的最佳实践? [英] best practice with tagclouds or tagCloud logic?
问题描述
您想出了什么好的标签云逻辑?就像fontsize = factor * OperationOfOccurance ....
what are some good tag Cloud logic that you had come up with? like fontsize = factor * percentageOfOccurance ....
推荐答案
您需要设置一个最小大小,例如fontsize = minsize + factor * percentage
.
You'll need to set a minimum size, so maybe fontsize = minsize + factor * percentage
.
您可能希望限制大小范围;也许取平方的平方或对数,但这取决于您的分布.
You may want to limit the range of sizes; perhaps take the sqrt or log of percentage, but this depends on your distribution.
有关另一种技术,请在标签云算法:
For another technique, have a look at this blog post from poeticcode on Tag Clouds Algorithms:
接下来,在线性插值中,如何设置字体大小/颜色强度的最小和最大边界?我注意到,例如Amazon.com的字体大小介于80%和280%之间.因此,云中最低的标签将获得80%的字体大小,而最高的标签将获得280%的字体大小.我决定采用以下公式
Next, in the linear interpolation, how do we set the min and max boundaries for the font size/color intensity? I notice that Amazon.com for example, is ranging it’s font sizes between 80% and 280%. So, the lowest tag in the cloud would get a font size of 80% and the highest tag 280%. I have decided to go with the following formula
150 *(1.0+(1.5 * m-maxm/2)/maxm)
150*(1.0+(1.5*m-maxm/2)/maxm)
当度量从潜在的0变为最大值时,这可以很好地使字体大小从75%变为300%.
This nicely gives a font size from 75% to 300% as the metric changes from a potential 0 to maxm.
这篇关于tagclouds或tagCloud逻辑的最佳实践?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!