Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set complement and intersection subset areas #23

Open
kamukondiwa opened this issue Sep 30, 2014 · 7 comments
Open

Set complement and intersection subset areas #23

kamukondiwa opened this issue Sep 30, 2014 · 7 comments

Comments

@kamukondiwa
Copy link

I am a big fan of your project, thanks for the good work. I would like to select and interact with any individual subset areas in the same way as is possible with intersection areas. Does this library already support this? If not is there any plan to implement this in the near future?

I would like to be able to select areas such as A ∖ (B ∪ C), B ∖ (A ∪ C) etc in the example below:
venn

Kind Regards,
Vern

@benfred
Copy link
Owner

benfred commented Oct 3, 2014

Its not supported right now, and its kinda tricky to do in general. The areas might not be contiguous like here with the blue 'A' circle:
screen shot 2014-10-02 at 9 37 26 pm

Interacting with the intersection areas is only possible because I spent some time calculating the area - which required breaking the intersection area down into something that can be translated to a svg path pretty easily. Its not quite as straightforward because of cases like above for what you're asking.

It might be possible to do this with svg clipping instead (like in here: https://gist.github.com/mbostock/1067636) though I haven't looked at it that much

@igravious
Copy link

I need this ability as well. I reckon the way to do it is to cheat, just find the correct coloured pixels. I'm going to attempt this this evening. Also, I'm going to only do the simple case where the area is contiguous by forcing the circles to be all positioned concentrically about a common mid-point if you know what I mean!

@ccario83
Copy link

ccario83 commented Aug 3, 2016

First of all, thanks for a really great library-- I'm a big fan!

This issue relates to the labeling of intersection areas as well:
screen shot 2016-08-03 at 11 58 58 am

The labels are a bit misleading in that without a hover to indicate the selected intersection, one might assume a number represents a different intersection. In this case, there are 411 in the intersection of all 4 sets, but 437 is displayed.

A good default behavior would be to display the most intersected set's size, as other values can be recapitulated by adding adjacent intersections. The current label system makes it impossible to compute all intersection sizes (e.g. A∩B∩C∩D).

@avnersch
Copy link

Here's my attempt to make all the venn area parts selectable:
https://codepen.io/avnerz/pen/dJPWee

@igravious
Copy link

@avnersch Ooh. Very nice. Well done.

@baimingze
Copy link

@avnersch Great! Could you please tell me how to assign the size to each venn area part?

@djhahe
Copy link

djhahe commented Apr 8, 2019

Hi @benfred,
I saw that there is a PR may resolve this problem. Can you take a look ?
#105

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants