venn.js icon indicating copy to clipboard operation
venn.js copied to clipboard

Selection edges not constrained to intersection

Open ghost opened this issue 8 years ago • 2 comments

It seems to me that the highlighted region edges do not match the selected intersection. For example, in the screen shot below, the highlighted area seems to include A∩B∩C and B∩C, i.e. (A∩B∩C) ∪ (B∩C) . However, the mouse is only hovering over B∩C, and the count is correctly given for just B∩C.

attached screen shot

Or am I not interpreting things correctly here?

This particular example was produced with this data:

[
{"sets":["A","B","C"],"size":1},
{"sets":["A","B"],"size":1},
{"sets":["A","C"],"size":1},
{"sets":["B","C"],"size":1},
{"sets":["A"],"size":3},
{"sets":["B"],"size":3},
{"sets":["C"],"size":3}
]

Thank you for this great package. I have found creating venn diagrams surprisingly tricky!

ghost avatar Oct 27 '17 18:10 ghost

This package assumes that the set areas overlap - so the size of A includes the size of A∩B and A∩C and A∩B∩C in it. In other words, the size of the inputs aren't assumed to be disjoint from all the other areas.

When it selects B∩C its trying to show all the items that are in common between B and C, which will include those that are also shared by A.

There is some talk about this in this issue https://github.com/benfred/venn.js/issues/23

Hope this helps!

benfred avatar Nov 01 '17 16:11 benfred

Yes, fair enough. Indeed, I now realize that (A∩B∩C) ∪ (B∩C) is the same as just (B∩C).

But in our use case it is important to know how many are, for example, in B and C but not A, i.e. (B∩C) - (A∩B∩C). I.e., how many are just in the region where the mouse pointer is in the screen shot above. Sounds like that is not possible in the present version?

ghost avatar Nov 07 '17 03:11 ghost