上下文

看看Wordle: http://www.wordle.net/ 它比我见过的任何其他词云生成器都好看得多 注意:源代码不可用-阅读常见问题:http://www.wordle.net/faq#code

我的问题

有没有一种算法可以做到Wordle所做的呢? 如果没有,有什么替代方案可以产生类似的输出?

我为什么问这个问题

只是好奇 想要学习


http://code.google.com/apis/visualization/documentation/gallery.html

看看单词云可视化。不像wordle.net那么花哨,但很容易添加到你的网站。


我是Wordle的创造者。以下是Wordle的实际工作原理:

数单词,扔掉无聊的单词,按数量排序,降序排列。保留前N个单词的N个,为每个单词分配与其计数成比例的字体大小。使用Java2D API为每个单词生成一个Java2D Shape。

每个单词“都想”在某个地方,比如“在垂直中心的某个随机x位置”。按照出现频率的递减顺序,对每个单词执行以下操作:

place the word where it wants to be
while it intersects any of the previously placed words
    move it one step along an ever-increasing spiral

就是这样。困难的部分是如何有效地进行交叉测试,为此我使用了最后一次缓存、分层边界框和四叉树空间索引(所有这些都是您可以通过google了解更多的东西)。

编辑:正如Reto Aebersold指出的,现在有一本书的章节,免费提供,涵盖了同样的领域:美丽的可视化,第3章:Wordle


我已经实现了Jonathan Feinberg所描述的算法,使用python创建了一个标记云。它与wordle.net的美丽云相去甚远,但它让你知道如何做到这一点。

你可以在这里找到这个项目。


我正在研究WordCram,一个用于制作词云的处理库。它受到Wordle的很大影响,并被上面链接的相同的PDF aeby告知。它为你处理碰撞检测,让你专注于你想要的文字布局,颜色,旋转等。


我有一个标签云生成器在这里,我称之为Disorganizer:)

TagCloudService来源 还有剃须刀的价格控制 以及用于测试的WinForm 你可以把它放在你的博客,个人资料等,用一个小包装它。它使用c# 4.0 & System。大量绘制命名空间。

我创建它是因为使用其他云生成器,你不能点击标签导航,也不能创建悬停动画,以显示它们是可点击的。因为在HTML中显示悬停动画对我来说是必要的(我用覆盖,绝对定位<a>标签来做这个),我没有开发任何角度的单词显示-它们要么垂直要么水平。

警告:上面的链接可能会在几个月内失效,我计划慢慢地把它从周围的项目解开到一个单独的项目中。

您可以在这篇示例博客文章中看到一个工作演示,但它是不完整的,并且位于一个不完整的站点中。如果有人想投稿,请联系我,我会尽快把它分开。


我正在寻找一个类似文字的可视化,它可以分配与其他数据相关的字符串的颜色,初始位置和大小,例如文本中的相关性-没有找到任何东西,但多亏了我在这里找到的信息(特别是Jonathan的解释和aeby的链接),我终于可以实现“Cloudio”,它相对接近wordle(至少我是这样认为的…),并提供了我正在寻找的功能。

It is implemented with SWT and JFace, and I tried to integrate it into the MVC-model of JFace, such that you can set content- and label-providers to modify the layout of a cloud and add it to other Eclipse-plugins or RCP apps. You can also modify the way the initial position of a string is calculated, such that is not difficult to use it for cluster visualization or else. It is still poorly documented and limited in some ways (and I did the initial upload a few hours ago, so it might still be a bit buggy), but if you're interested, here's the link:

如果你想快速了解一些云,这里有一个链接:https://github.com/sschwieb/Cloudio/wiki/Example-Clouds

干杯, 斯蒂芬


这里看到我像云一样实现Wordle。 它使用相同的螺旋算法和四叉树数据结构。

http://sourcecodecloud.codeplex.com

or

http://www.codeproject.com/Articles/224231/Word-Cloud-Tag-Cloud-Generator-Control-for-NET-Win


我创建了一个Silverlight组件,它使用Jonathan在这里建议的算法。源代码和示例项目都可以在我的博客上找到:

http://whydoidoit.com

我的云可以让你根据不同的权重为单词着色和大小,它支持单词选择(从坐标)和选中的单词高亮显示。源代码是您的,您可以根据需要使用。


这是一个非常好的javascript代码,来自Jason Davies,它使用了d3。你甚至可以使用web字体。

演示: http://www.jasondavies.com/wordcloud/

Github: https://github.com/jasondavies/d3-cloud


狮子和羔羊是一款开源的iOS应用程序,它可以使用圣经中最常用的单词来创建单词云。

它是基于乔纳森·范伯格所描述的算法。命中测试确实利用了四叉树,但是边界框是基于符号的边界矩形的。我想把字形分解成许多更小的边界矩形,以便在字形的边界框中放置单词。

GitHub: https://github.com/PetahChristian/LionAndLamb


这是Python 3中wordle的另一个端到端实现,主要基于Jonathan Feinberg的初始轮廓(四叉树、螺旋等)。

代码(注释,详细的ReadMe文件)在这个Github库中免费提供,这是一个用代码创建的示例wordle。


Tim Dream制作了一个非常不错的JavaScript库:

https://github.com/timdream/wordcloud2.js/blob/gh-pages/API.md

它可以在画布上或HTML标签上创建文字云,并提供许多选项来修改结果。它非常接近wordle的输出。


I've implemented a word cloud generator called WordCloud.jl in Julia language. A brief description about its algorithm can be found here. Unlike most other implementations, I designed it based on gradient optimization. It’s a non-greedy algorithm in which words can be further moved after they are positioned. Thus the size of the words and the shape and size of the background mask can be kept unchanged in the generation process. This makes the outputs more accurate and easy to customize. Furthermore, we can also generate some fancy outputs like these: Comparison of Obama's and Trump's inaugural address and Wikipedia: Julia