问题描述
您想出了什么好的标签云逻辑?就像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:
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逻辑的最佳实践?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!