benfred / venn.js

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

Exception case of 4 circles (one is all inclusive) #134

Open tanykim opened 5 years ago

tanykim commented 5 years ago
screen shot 2019-01-14 at 12 47 11 pm

The image is generated from this dataset:

[  {sets: ['A'], size: 9729886},
    {sets: ['B'], size: 6462374},
    {sets: ['C'], size: 14719698},
    {sets: ['A', 'B'], size: 5161935},
    {sets: ['A', 'C'], size: 8934605},
    {sets: ['B', 'C'], size: 5917912},
    {sets: ['A', 'B', 'C'], size: 5049822} ]

Then I'd like to draw a big circle that includes all the three circles, so I made this Venn diagram set: the size of base is A + B + C - A^B - A^C - B^C + A^B^C.

[   {sets: ['base'], size: 20997150},
    {sets: ['base', 'A'], size: 9729886},
    {sets: ['base', 'B'], size: 6462374},
    {sets: ['base', 'C'], size: 14719698},
    {sets: ['base', 'A', 'B'], size: 5161935},
    {sets: ['base', 'A', 'C'], size: 8934605},
    {sets: ['base', 'B', 'C'], size: 5917912},
    {sets: ['base', 'A', 'B', 'C'], size: 5049822},
    {sets: ['A'], size: 9729886},
    {sets: ['B'], size: 6462374},
    {sets: ['C'], size: 14719698},
    {sets: ['A', 'B'], size: 5161935},
    {sets: ['A', 'C'], size: 8934605},
    {sets: ['B', 'C'], size: 5917912},
    {sets: ['A', 'B', 'C'], size: 5049822} ]

This one prints "Initial bisect points must have opposite signs" in line 273 of venn.js. I have many other datasets that look similar, all of others work great. When I removed set C, it's working. Only this specific dataset does not work. Any clues why?

jonnyrobbie commented 5 years ago

I feel this is the duplicate of #131