在数据可视化中排列圆圈 [英] Arranging circles in data visualisation

查看:109
本文介绍了在数据可视化中排列圆圈的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了实现数据可视化,我需要将各种大小的圆圈排列到一个紧凑的区域-矩形或圆形。 (请参见示例。 )

For my data visualisation I need to arrange various sized circles into a compact area - rectangle or circle. (See this and this example.)

从理论上讲,它是二维不规则的-削减库存问题,但我想避免那样做。您可以在网上找到类似的可视化效果,我怀疑它们是否使用了严格的数学运算。

In theory it is a two-dimensional-irregular-cutting-stock-problem but I would like to avoid going that way. You can find similar visualisations all over the web and I doubt they use any rigorous math.

我需要做的只是使圆以某种有序的方式排列(它们之间的距离大致相等)。必须有比削减股票数学更简单的方法。夸张地说,我什至可以想象2D物理引擎如何利用重力使圆落入所需形状的容器中。

All I need is the circles to appear to be arranged in some orderly fashion (with approximately same distance between them). There must be an easier way than cutting stock math. With some exaggeration I can even imagine how 2D physics engine could use gravity to make the circles fall into a container of desired shape.

我将非常感谢您提出的任何建议。 / p>

I will be thankful for any advice.

推荐答案

您要解决的问题称为圆形包装。寻找各种形状的最佳包装密度确实需要严格的数学计算。但是,我能够找到一些相对简单的圆形包装算法的开源示例。

The problem you're trying to solve is called "circle packing". Finding optimal packing densities in various shapes does indeed require rigorous math. However I was able to find some relatively simple opensource examples of circular packing algorithms.

http://wonderfl.net/c/fNNF

http://www.codeproject.com/Articles/42067/2D-Circle-Packing-algorithm-ported-to-C

这篇关于在数据可视化中排列圆圈的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆