benfred / venn.js

Area proportional Venn and Euler diagrams in JavaScript
MIT License
1.04k stars 218 forks source link

3 way overlaps drawn when there 3x2 way interactions #78

Closed navatintarev closed 7 years ago

navatintarev commented 8 years ago

The data contains three sets that all interact with each other pairwise, but there is no three way interaction. This is inferred and results in a joint overlapping area that should not be there. These exist: {Drama,Romance} {Comedy,Romance} {Comedy,Drama}

This does not exist: {Drama,Romance,Comedy}

What it looks like: screen shot 2016-08-12 at 17 41 12

Where the issue is: no_overlap

Novalis80 commented 7 years ago

you are right. the problem is, this can not be solved with circles. this is: if you want to sick to relative correct size.

benfred commented 7 years ago

So - the results here are an approximation process. Like I said in the 3rd and 4th paragraph of my blog post introducing this project:

The problem is that even for only 3 sets, its not always possible to position everything so that everything is area proportional to the set sizes. Try changing A=B=C=8 , AB=AC=4 and BC=0 in the above example to see what I mean about impossible layouts. There is no way to exactly satisfy all those constraints. Even worse is trying to layout Euler diagrams with 4+ sets: if there are no disjoint sets, its actually impossible to use circles to represent these set relations exactly.

I still want the best possible approximation even if its not possible to be perfect all the time. So I did the sensible thing here: define a function that measures how well a layout matches the desired overlaps - and then minimize that function numerically.

In your case, It doesn't look like there is a better layout for that data.