We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 10 months ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
您正在寻找树形映射算法。实现后,您可以将输出(应该是矩形)转换为任何可以绘制分层矩形的绘图命令。
编辑:
更多链接和信息:
如果您不介意阅读论文,基于浏览器的d3 库提供“方形”树形图 (js实施)。他们引用了 Bruls、Huizing 和 van Wijk。 (这也是维基百科文章中的引用 3)
我会搜索链接的维基百科文章中列出的算法。例如,他们还链接到这篇文章,该文章描述了“混合树形图”的算法。本文最后还包括一些有趣的部分,描述了向非矩形形状的转换。
Squareified 无疑是最常见的品种。上面的链接应该足以让您找到解决方案,甚至直接移植 d3 实现。然而,grokking d3 模型(类似于 jQuery 的声明式形式)的成本可能有点高。但乍一看,实施似乎相对简单。
You're looking for Treemapping algorithms. Once implemented, you can transform the output (which should be rectangles) into plotting commands to anything that can draw layered rectangles.
Edit:
More links and information:
If you don't mind reading papers, the browser-based d3 library provides for 'squarified' treemaps (js implementation). They reference this paper by Bruls, Huizing, and van Wijk. (This is also citation 3 on the wikipedia article)
I'd search on the algorithms listed on the linked Wikipedia article. For instance, they also link to this article, which describes an algorithm for "mixed treemaps". The paper also includes some interesting portions at the end describing transformations into other-than-rectangular shapes.
Squarified certainly appears to be the most common variety around. The above links should give you enough to work towards a solution or, even, directly port the d3 implementation. However, the cost of grokking d3's model (which is something like a declarative form of jQuery) may be somewhat high. At first glance, though, the implementation appears relatively straightforward.