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

specify a circle size for scale

Open harlanlewis opened this issue 9 years ago • 4 comments

Hi there, great work on venn.js!

We're using it to display a number of different results relative to a single value, as in this screenshot with each venn containing a circle with value 224:

image 2016-07-26 at 10 17 45 am

Is there a way to specify a size for a single circle in a set to establish scale? For our use, consistently sizing the 224 circle would make it much easier to compare values across multiple venns.

I'd expect this to interact with SVG width and height, as circles could be larger than the SVG boundaries. Clipping at the SVG edges seems satisfactory.

If this isn't supported or planned, would you be open to a PR supporting it?

Also, thanks for adding circle sorting (https://github.com/benfred/venn.js/issues/56), a big help for our use case!

harlanlewis avatar Jul 26 '16 17:07 harlanlewis

So - the scale is dynamically calculated in the src/layout.js:scaleSolution function based off the width/height and size of the solution.

To maintain a constant scale, I think what you want to do is add a 'scale' attribute to the VennDiagram object and then have the scaleSolution function use it if set instead of calculating based off of width/height.

I can add this pretty easily, but won't have a chance until at least this weekend. If you want to do it, I'm open to a PR =)

benfred avatar Jul 26 '16 18:07 benfred

Thanks for the response! That approach makes sense to me. I'm also unlikely to get to it this week, but if you leave it open I'm happy to give it a shot in August.

harlanlewis avatar Jul 26 '16 18:07 harlanlewis

Was the ability to set a constant scale ever added to the library? I also have multiple venn diagrams on a page, and would like the ability to compare values across multiple venns.

wykhuh avatar Sep 10 '18 00:09 wykhuh

Also need to use this feature in a project I'm working on! Checking in again on if this has been implemented or not

noahfinerp avatar Jun 25 '19 19:06 noahfinerp