创建 TreeMap 可视化
我想要创建树状图可视化的算法。
像这样的东西: 一种简单的制作方法树形图
问题是我不想使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
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.
维基百科文章最后似乎有一些很好的链接。
我可能会首先尝试递归和比例除法的简单方法。在树的第一层,垂直划分目标区域(这里的每个区域都是一个分支,区域大小取决于分支大小):
在第二层,水平划分:
在第三层再次垂直划分:
等等。
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.
这是另一个很好的入门 - 有很多内容需要阅读,并且包含树状图的存档算法。可视化部分可能会丢失。
This is another good starter - a LOT to read and an archive containing treemap algorithms. The visualization part may be missing.
Prefuse 还实现了 TreeMap。这是一个示例。以下是示例代码。
Prefuse also has implemented a TreeMap. Here's an example. Here's the code for the example.
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.
另一种选择是使用 JavaScript 库,该库将负责算法方面,并仅关注通过操作 CSS 的表示部分。
查看 D3 示例: http://mbostock.github.com/d3/ex/treemap .html
您可以为每个 div 添加
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