创建 TreeMap 可视化

发布于 2024-09-13 14:56:54 字数 267 浏览 8 评论 0原文

我想要创建树状图可视化的算法。

像这样的东西: 一种简单的制作方法树形图

问题是我不想使用 R ...并且我想要源代码。最好是 Python 或 Java。

问题是我必须自定义它......而不是颜色我想要图像,所以给我坐标的东西会很棒。

谢谢,

I want the algorithm for creating a Treemap visualization.

Something like this: An Easy Way to Make a Treemap

Problem is that I do not want to use R ... and I want the source-code. Preferably in Python or Java.

Thing is that I have to customize it ... instead of colors I want images, so something that gives me coordinates would be awesome.

Thanks,

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

最近可好 2024-09-20 14:56:54

SourceForge.net 上的 TreeMap Java 库
Ben Schneiderman 的论文。

还有一个参考实现链接到 Schneiderman 的 树形图历史页面

The TreeMap Java Library on SourceForge.net is an open source implementation of the
algorithm described in Ben Schneiderman's paper.

There is also a reference implementation linked to from Schneiderman's Treemap History page.

番薯 2024-09-20 14:56:54

维基百科文章最后似乎有一些很好的链接。

我可能会首先尝试递归和比例除法的简单方法。在树的第一层,垂直划分目标区域(这里的每个区域都是一个分支,区域大小取决于分支大小):

+-------+-------+-------+
|       |       |       |
|       |       |       |
|       |       |       |
|       |       |       |
|       |       |       |
|       |       |       |
+-------+-------+-------+

在第二层,水平划分:

+-------+-------+-------+
|       |       |       |
+-------+       |       |
|       +-------+       |
|       |       |       |
|       |       +-------+
|       |       |       |
+-------+-------+-------+

在第三层再次垂直划分:

+--+----+----+--+----+--+
|  |    |    |  |    |  |
+--+-+--+    |  |    |  |
|    |  +-+--+--+    |  |
|    |  | |     |    |  |
|    |  | |     +---++--+
|    |  | |     |   |   |
+----+--+-+-----+---+---+

等等。

The wikipedia article seems to have some good links at the end.

I'd probably first try the easy approach of recursion and proportional division. At first level of the tree, divide the target area vertically (each area here is a branch, area size depends on branch size):

+-------+-------+-------+
|       |       |       |
|       |       |       |
|       |       |       |
|       |       |       |
|       |       |       |
|       |       |       |
+-------+-------+-------+

At second level, divide horizontally:

+-------+-------+-------+
|       |       |       |
+-------+       |       |
|       +-------+       |
|       |       |       |
|       |       +-------+
|       |       |       |
+-------+-------+-------+

At third level divide vertically again:

+--+----+----+--+----+--+
|  |    |    |  |    |  |
+--+-+--+    |  |    |  |
|    |  +-+--+--+    |  |
|    |  | |     |    |  |
|    |  | |     +---++--+
|    |  | |     |   |   |
+----+--+-+-----+---+---+

Etc.

眉黛浅 2024-09-20 14:56:54

这是另一个很好的入门 - 有很多内容需要阅读,并且包含树状图的存档算法。可视化部分可能会丢失。

This is another good starter - a LOT to read and an archive containing treemap algorithms. The visualization part may be missing.

简单爱 2024-09-20 14:56:54

Prefuse 还实现了 TreeMap。这是一个示例。以下是示例代码

Prefuse also has implemented a TreeMap. Here's an example. Here's the code for the example.

别把无礼当个性 2024-09-20 14:56:54

IBM ManyEyes 允许您将数据显示为树状图:

http:// /www-958.ibm.com/software/data/cognos/manyeyes/page/Treemap.html

它采用表数据作为输入。结果是交互式的,您可以获取树状图每个部分的详细信息、过滤和重新组织树状图。

缺点是缺乏定制(色阶,..)以及 Java 的笨重。

IBM ManyEyes let you show your data as Treemap:

http://www-958.ibm.com/software/data/cognos/manyeyes/page/Treemap.html

It takes table data as input. The result is interactive you can get details for each part of the treemap, filter and re-organize the treemap.

Drawbacks are the lack of customization (color scale, ..) and the heaviness of Java.

单挑你×的.吻 2024-09-20 14:56:54

另一种选择是使用 JavaScript 库,该库将负责算法方面,并仅关注通过操作 CSS 的表示部分。

查看 D3 示例: http://mbostock.github.com/d3/ex/treemap .html

您可以为每个 div 添加

background-image: url('path/to/image.png');

Another option is to use a JavaScript library that will take care of the algorithm side and focus only on the presentation part with manipulating the CSS.

Check out for example D3: http://mbostock.github.com/d3/ex/treemap.html

You can add for each of the divs

background-image: url('path/to/image.png');
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文