benfred/venn.js

Forcing circle position (with 2 sets) ?

Leobouloc opened this issue · 2 comments

Hello,

I am using venn.js to display the overlay between 2 sets. In my display, I would like to control which set is displayed on the right and which one is displayed on the left. By default, it seems like the larger set will always be displayed on the left.

Is there an option to force the display position? If not, would you consider implementing such an option?

Thank you.

There is an 'orientation' parameter on the chart that controls which way this points.

For instance to get what you want would be something like:

// define sets and set set intersections
var sets = [ {sets: ['A'], size: 12},
             {sets: ['B'], size: 6},
             {sets: ['A','B'], size: 2}];

var chart = venn.VennDiagram()
    .orientation(-Math.PI/2);
d3.select("#venn").datum(sets).call(chart);

And results in something like:

screenshot from 2017-10-10 10-23-42

There is also

HJWAJ commented

What if 3 sets? If I would like A to left-top and B right-top and C bottom.