将集合层次结构可视化为颜色编码图形 [英] Visualizing set hierarchies as color coded graphs

查看:155
本文介绍了将集合层次结构可视化为颜色编码图形的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近一直在阅读有关Java和Javascript图形库的相关内容,但我还没有找到一个很好的方法来做我想做的事情。

I have been reading quite a bit on graphing libraries for Java and Javascript lately but I haven't found a good way to do what I want to do.

基本上我有一组关于一堆元素的集合(最多几千个)。这些组可以完全或部分重叠,完全覆盖或完全彼此不相交。我想要做的是显示以下信息:

Essentially I have a hierarchy of sets with regards to a bunch of elements (up to several thousands). These sets can be fully or partly overlapping, fully covering or completely disjoint from one another. What I would like to do is to display the following information:


  • 集合的大小(与其他集合相关)

  • 根据其涵盖的元素计算的集合的热值(颜色代码)

  • 单个图中集的完整拓扑(这样就可以向用户显示重叠,交叉点等)

编辑:也许我应该举例说明我所说的集合和元素以及部分重叠的层次结构。以下是我处理的那种套装的过度简化版本(注意数字 1 - 10 和字母 a - h X 表示可比较的元素彼此):

Perhaps I should give an example of what I mean by sets and elements and partially overlapping hierarchies. The following is an over-simplified version of the kind of sets I deal with (note that numbers 1-10 and letters a-h and X represent elements which are comparable to one another):

Set1 = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}
Set2 = {1, 2, 3, 4, 5, 6}
Set3 = {1, 2, 3}
Set4 = {1, 4, 5, 6, 7}
Set5 = {a, b, c, d, e, f, g, h}
Set6 = {a, b, c, d, e}
Set7 = {a, b, c, 7}
Set8 = {2, 4, 7, 8, c, f}
Set9 = {X}






我不确定如何以直观的方式显示这些信息。我见过Voronoi ¹²图表,我真的很喜欢它们,但是它们有不同的数学背景,所以我认为我不能以适当的方式描绘我所拥有的层次结构。我想在运行时(在Java的情况下)或在HTML部署的情况下使用Javascript创建这些图,要么非常好。然而,有一个限制因素是图形需要创建或可以导出到高分辨率矢量图形。


I am not sure how I would go about displaying this information in an intuitive way. I have seen Voronoi ¹,² graphs which I really like visually, however they have a different mathematical background so I don't think I'll be able to portray the hierarchies I have in a proper manner. I would like to create these graphs during runtime (in case of Java) or using Javascript in case of HTML deployment, either is perfectly fine. One thing that is a constraint, however, is that the graphs need to be either created, or can be exportable, to high-res vector graphics.

我的问题简短:


  1. 有没有一种很好的方法可视化我有哪些数据?如果它存在于一个易于实现的形式(即图书馆)?

  2. 如果没有简单的解决问题的方法,换句话说,如果我需要在这种情况下发明我的方向盘,我如何自己实现这样的图表?什么是一个好的起点?我应该特别注意什么?

谢谢!

编辑:我可能的想法是将通用集中的所有元素布局为具有所需颜色叠加的六边形网格,然后绘制集合的边界。然而,该想法存在若干问题,特别是指定元素的位置的问题,使得集合不会在整个图形上分割。有什么意见/建议吗?

I potential idea I had was to layout all the elements in the universal set as a hexagonal grid with the desired color overlay, and then draw the boundaries for the sets. There are however several problems with that idea, in particular the problem of designating locations for the elements, so that the sets are not split all over the graph. Any comments/suggestions?

推荐答案

是的,这是一个相当充分研究的问题。您所描述的内容称为超图。每个元素都可以表示为图形中的顶点,并且这些集合是超边界。然后问题变成可视化超图。

Yes, this is a fairly well-studied problem. What you are describing is called a hypergraph. Each element can be represented as a vertex in a graph, and the sets are the hyperedges. The problem then becomes that of visualizing hypergraphs.

不幸的是,由于即使是最简单的图形也可能具有复杂的可视化效果,因此没有完美的通用解决方案。

Unfortunately there isn't a perfect, generalized solution to this since even the simplest graphs can have complex visualizations.

如果您的集合相对较小(<5个元素),您可以使用常规图形绘制库,如 graphviz的。要做到这一点,只需连接每组中的所有顶点对,然后对它们进行不同的着色。这将产生类似于此的解决方案:

If your sets are relatively small (< 5 elements), you can use a regular graph drawing library like graphviz. To do this, simply connect all pairs of vertices within each set and color them differently. This will yield a solution similar to this:

这篇关于将集合层次结构可视化为颜色编码图形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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