如何在ASP.NET中创建标签云?

时间:2021-10-19 04:09:53

I'm venturing into web programming for the first time and would like a nice way to display a frequency indicator of some data, in the form of a tag cloud.

我第一次冒险进入网络编程,并希望以标签云的形式显示一些数据的频率指示器。

For example, pretend I have some simple data of three types of pets: Dog, Cat, Monkey.

例如,假装我有三种宠物的简单数据:狗,猫,猴子。

There are 5 Dogs, 27 Cats and 101 Monkeys.

有5只狗,27只猫和101只猴子。

Given this data, what's the best way to make a tag cloud to visually indicate that I have way too many monkeys, not as many cats, and that I definitely need obtain a few more dogs?

鉴于这些数据,制作标签云的最佳方式是什么才能直观地表明我有太多的猴子,而不是那么多的猫,而且我肯定需要再多买一些狗?

Update: It would be great if the solution was actually discussed and answered on *. Linking externally is good to help support the answer, but leaving the links as an answer is not necessarily what * is about. Anyone can google to find what has been linked. The hope is that * will be the place to find the answer. This is just a request to help make * better. :)

更新:如果在*上实际讨论并回答了解决方案,那将会很棒。外部链接很有助于支持答案,但将链接留作答案并不一定是*的内容。任何人都可以谷歌找到已链接的内容。希望*将是找到答案的地方。这只是一个帮助使*更好的请求。 :)

4 个解决方案

#1


2  

I don't believe this is the answer you're looking for, but there is a Cloud Control for ASP.NET available at CodeProject:

我不相信这是您正在寻找的答案,但CodeProject提供了一个适用于ASP.NET的Cloud Control:

http://www.codeproject.com/KB/aspnet/cloud.aspx

It's looks fairly easy to use.

它看起来相当容易使用。

--

Edit: I should probably credit my source. The link above was found on the following web page:

编辑:我应该相信我的来源。上面的链接可在以下网页上找到:

http://www.technacular.com/2007/04/22/how-to-create-a-tag-cloud/

This page contains some additional general information related to building a Tag Cloud. Best of luck!

此页面包含一些与构建Tag Cloud相关的其他常规信息。祝你好运!

#2


1  

You need to first decide your metric (i.e. what you want to measure, in this case number of pets per type), and second how you map that metric onto a set of classes. These classes are equivalent to the styles you attach to the tags.

您需要首先确定您的指标(即您要测量的内容,在这种情况下,每种类型的宠物数量),以及您如何将该指标映射到一组类。这些类等同于附加到标记的样式。

A quite simple mapping would be x[i] / sum(x) giving a ratio between 0 and 1. Define subranges on the range [0, 1], for example 4 ranges from 0..0.25, 0.25..0.50 and so on. Find the index of the subrange (0,1,2,3) and assign the tag a CSS class "tagX".

一个非常简单的映射是x [i] / sum(x)给出0和1之间的比率。定义范围[0,1]上的子范围,例如4范围从0..0.25,0.25..0.50等等上。找到子范围的索引(0,1,2,3)并为标记分配CSS类“tagX”。

#3


1  

There are many approaches and techniques...

有很多方法和技术......

Clustering Algorithms for Tag Clouds

标签云的聚类算法

Design Tips for Building Tag Clouds

构建标签云的设计技巧

#4


0  

I hope this would help.

我希望这会有所帮助。

http://aspnet.4guysfromrolla.com/articles/102506-1.aspx

#1


2  

I don't believe this is the answer you're looking for, but there is a Cloud Control for ASP.NET available at CodeProject:

我不相信这是您正在寻找的答案,但CodeProject提供了一个适用于ASP.NET的Cloud Control:

http://www.codeproject.com/KB/aspnet/cloud.aspx

It's looks fairly easy to use.

它看起来相当容易使用。

--

Edit: I should probably credit my source. The link above was found on the following web page:

编辑:我应该相信我的来源。上面的链接可在以下网页上找到:

http://www.technacular.com/2007/04/22/how-to-create-a-tag-cloud/

This page contains some additional general information related to building a Tag Cloud. Best of luck!

此页面包含一些与构建Tag Cloud相关的其他常规信息。祝你好运!

#2


1  

You need to first decide your metric (i.e. what you want to measure, in this case number of pets per type), and second how you map that metric onto a set of classes. These classes are equivalent to the styles you attach to the tags.

您需要首先确定您的指标(即您要测量的内容,在这种情况下,每种类型的宠物数量),以及您如何将该指标映射到一组类。这些类等同于附加到标记的样式。

A quite simple mapping would be x[i] / sum(x) giving a ratio between 0 and 1. Define subranges on the range [0, 1], for example 4 ranges from 0..0.25, 0.25..0.50 and so on. Find the index of the subrange (0,1,2,3) and assign the tag a CSS class "tagX".

一个非常简单的映射是x [i] / sum(x)给出0和1之间的比率。定义范围[0,1]上的子范围,例如4范围从0..0.25,0.25..0.50等等上。找到子范围的索引(0,1,2,3)并为标记分配CSS类“tagX”。

#3


1  

There are many approaches and techniques...

有很多方法和技术......

Clustering Algorithms for Tag Clouds

标签云的聚类算法

Design Tips for Building Tag Clouds

构建标签云的设计技巧

#4


0  

I hope this would help.

我希望这会有所帮助。

http://aspnet.4guysfromrolla.com/articles/102506-1.aspx