title: Visualizing set hierarchies as color coded graphs
body: <p>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. </p>
  
  <p>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:</p>
  
  <ul>
  <li>The size of a set (in relation to the other sets)</li>
  <li>A "heat" value (in color code) of a set calculated from the elements it covers</li>
  <li>The full topology of the sets in a single graph (so that overlaps, intersections etc are displayed to the user)</li>
  </ul>
  
  <hr>
  
  <p><strong>Edit:</strong> 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 <code>1</code>-<code>10</code> and letters <code>a</code>-<code>h</code> and <code>X</code> represent elements which are comparable to one another):</p>
  
  <pre><code>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}
  </code></pre>
  
  <hr>
  
  <p>I am not sure how I would go about displaying this information in an intuitive way. I have seen Voronoi <a href="http://en.wikipedia.org/wiki/Voronoi_diagram">¹</a>,<a href="http://mbostock.github.com/d3/ex/voronoi.html">²</a> 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. </p>
  
  <p>My questions in short: </p>
  
  <ol>
  <li>Is there a nice way to visualize the kind of data I have? If so does it exist in a readily implemented form (i.e. a library)?</li>
  <li>If there is no easy solution to the problem, in other words if I need to invent my wheel in this case, how do I go about implementing such a graph myself? What is a good starting point? What do I pay extra attention to?</li>
  </ol>
  
  <p>Thanks!</p>
  
  <p><strong>Edit:</strong> 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? </p>