如何制作 voronoi 树形图?

发布于 2024-07-18 21:16:46 字数 1493 浏览 10 评论 0原文

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

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

发布评论

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

评论(7

不如归去 2024-07-25 21:16:46

刚刚找到这个页面。 在将 Benjamin Dittes 的 Steven Fortune 算法的 C# 版本翻译成 Javascript 后,我​​一直在使用 Javascript/canvas 开发一个 Voronoi 演示小程序(可在 Code Project 中找到,请参阅“Fortune's Voronoi 算法在 C# 中实现”)。 这是在 Javascript 中包含《财富》Voronoi 算法的页面:
http://www.raymondhill.net/voronoi/voronoi.php
这是第一次迭代,我计划进一步调整它以更好地适合 Javascript。 希望这可以帮助。

Just found this page. I've been working on a Voronoi demo applet using Javascript/canvas, after translating into Javascript a C# version of Steven Fortune's algorithm by Benjamin Dittes (available at Code Project, see "Fortune's Voronoi algorithm implemented in C#"). Here is the page which include Fortune's Voronoi algorithm in Javascript:
http://www.raymondhill.net/voronoi/voronoi.php
This is a first iteration, I plan to adapt it further to be better suited to Javascript. Hope this helps.

|煩躁 2024-07-25 21:16:46

首先,这些线条并不奇怪:这是因为这不是正常的 Voronoi 曲面细分,而是面积加权 Voronoi (AWT) 曲面细分,甚至可能是质心 Voronoi 曲面细分 (CVT)。 话虽这么说,为了使 Voronoi 区域(多边形)具有显着不同的面积(这将反映数据的某些属性),您需要 AWT(最好实现为 CVT 以保留多边形的良好纵横比); 普通的 Voronoi 算法(如上面一些人所建议的)将无法帮助您。 对于这个问题可能没有直接的解决方案,尤其是对于脚本语言来说,因为 AWT 的迭代更新步骤导致的计算复杂性非常高。 您应该查找 Balzer 等人关于“Voronoi Treemaps”和“Dynamic Voronoi Treemaps”的工作。 和苏德等人。 了解该算法,然后自己实现它(您需要的一切都在他们的论文中)。

First of all, the lines are not strange: it's the result of the fact that this is not a normal Voronoi tessellation, but an area-weighted Voronoi (AWT) tessellation, possibly even a centroidal Voronoi tessellation (CVT). That being said, in order to have Voronoi regions (polygons) with significantly differing areas (which would reflect some attribute of the data), you need AWTs (preferably implemented as CVTs to retain nice aspect ratios for the polygons); a normal Voronoi algorithm (as suggested by some people above) will not be able to help you. There is probably no direct solution for this available, especially not for scripted languages, since the computational complexity due to iterative updating steps for AWTs is quite high. You should look up the work on "Voronoi Treemaps" and "Dynamic Voronoi Treemaps" by Balzer et al. and Sud et al. to get an idea of the algorithm and then implement it on your own (everything that you need is in their papers).

梅窗月明清似水 2024-07-25 21:16:46

另一个Python答案似乎指向仅光栅解决方案。 我也有兴趣解决这个问题(在Python中),我认为以下脚本可以形成一个可用的起点:

http://www.oxfish.com/python/voronoi.py

(回程时存档的副本

the other Python answer seems to point at a raster only solution. I am also interested in solving this problem (in Python) and I think the following script could form a usable starting point:

http://www.oxfish.com/python/voronoi.py

(Archived copy at wayback)

作妖 2024-07-25 21:16:46

James Tauber 正在编写一个教程,该教程使用 JavaScript 和 Fortune 算法 在中绘制 Voronoi 图一个 canvas 元素: Voronoi Canvas 教程

尚未完成(他已完成第 4 部分中的第 3 部分),但我认为已经足够完成它了。

James Tauber is writing a tutorial that uses JavaScript and Fortune's algorithm to draw a Voronoi diagram in a canvas element: Voronoi Canvas Tutorial

It's not complete yet (he's at part 3 of 4) but there's enough there to complete it I think.

唯憾梦倾城 2024-07-25 21:16:46

Macrofocus TreeMap 的最新版本 (2.0) 提供了 Voronoi 算法等选项。

The latest version (2.0) of Macrofocus TreeMap has the Voronoi algorithm as an option, among others.

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