benfred / venn.js

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

Intersection of 3 sets missing [Union of Empty Sets] #98

Closed theavijitsarkar closed 7 years ago

theavijitsarkar commented 7 years ago

I cant figure out why this is happening. I have three sets, all intersect with each other. However the intersection of all of them is not showing. For example.

screen shot 2017-07-27 at 9 32 33 pm

var sets = [
  {
    "sets": [
      "Present"
    ],
    "size": 10,
    "label": "Present"
  },
  {
    "sets": [
      "Holiday"
    ],
    "size": 1,
    "label": "Holidays"
  },
  {
    "sets": [
      "WeeklyOff"
    ],
    "size": 12,
    "label": "Weekly Offs"
  },
  {
    "sets": [
      "Present",
      "Holiday",
      "WeeklyOff"
    ],
    "size": 1
  },
  {
    "sets": [
      "Present",
      "Holiday"
    ],
    "size": 0
  },
  {
    "sets": [
      "Present",
      "WeeklyOff"
    ],
    "size": 1
  },
  {
    "sets": [
      "WeeklyOff",
      "Holiday"
    ],
    "size": 0
  }
]

If you see the intersection of all the three is not happening.

Are these solutions possible? img_20170727_220840690

benfred commented 7 years ago

size: 0 in your code snippet above indicates that you want the 'holidays' set to be disjoint from the other two sets. It should be size: 1 instead