php – 使用tagclouds或tagCloud逻辑的最佳实践?
作者:互联网
您提出了什么样的好标签云逻辑?像fontsize = factor * percentageOfOccurance ….
解决方法:
您需要设置最小尺寸,因此可能fontsize = minsize factor * percentage.
您可能希望限制尺寸范围;也许取sqrt或log百分比,但这取决于你的分布.
对于另一种技术,请查看Tag Clouds Algorithms上poeticcode的博客文章:
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)
This nicely gives a font size from 75% to 300% as the metric changes from a potential 0 to maxm.
标签:php,tags,tag-cloud 来源: https://codeday.me/bug/20190526/1159377.html