如何创建一个简单的标签云?使用C#和造型与CSS [英] How to create a Simple tag cloud? Using C# and Styling with css

查看:121
本文介绍了如何创建一个简单的标签云?使用C#和造型与CSS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现它不可能创造一个标签云,我找不到任何演练的或教程。 (即至少工作的)。

I'm finding it impossible to create a tag cloud, I can't find any walkthrough’s or tutorials. (ones that work at least).

我只是想找一个工作标签云的简单,基本的例子之后,我可以香料它。

I'm just looking for a simple, basic example of a working tag cloud and I can spice it up after that.

我找到的最好的链接是:

The best link i found is:

http://www.geekzilla.co.uk/ View960C74AE-D01B-428E-BCF3-E57B85D5A308.htm

但它过时,我无法下载源文件,并有在code不少差距。

But it's out dated and I can't download the source file, and there are many gaps in the code.

推荐答案

这是不是一个真正的难题。从本质上讲标签云只不过是一个字体大小链接到方式的标签是多么常见的。

This isn't a really hard problem. Essentially a tag cloud is just a way of linking the fontsize to the how common the tag is.

第一件事情就是多久标签显示:

First thing is how often does the tag appear:

select Value, Count(*)
from Tag
group by Value
order by Count(*)

然后,当您渲染此ResultSet到页面上,有一定的排序算法,以便对每个标签和重新present它作为一个字体大小计数。一个天真的方法是直接设置字体大小来计数,但是这可能会导致无法读取的结果。相反,也许只是前10%为大字体,未来10%作为下一个字号下来,等你必须制定出适合您和您的数据的工作精确算法,虽然。

Then when you render this resultset to the page, have some sort of algorithm to take the count for each tag and represent it as a font size. A naive approach would be to set the fontsize directly to the count, but that's likely to lead to unreadable results. Instead, perhaps just have the top 10% as a large font, the next 10% as the next fontsize down, etc. You'll have to work out an exact algorithm that works for you and your data, though.

此外,标签云是真正的从几个观点(可读性,搜索,无障碍)有点垃圾。确保标签云不是为了获取标签的唯一途径。也许字母顺序或通过专用页面上COUNT(*)。

Also, tag clouds are really a bit rubbish from several points of view (readability, searching, accessibility). Make sure the tag cloud isn't the only way to get access to the tags. Perhaps in alpha order or by Count(*) on a dedicated page.

这篇关于如何创建一个简单的标签云?使用C#和造型与CSS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆