benfred/venn.js

Default loss function should use log ratio, not subtraction

adamabeshouse opened this issue · 0 comments

We're using your work for an upcoming release of cbioportal.org. We wanted more control over the rendering, so we used your exposed algorithms for computing layout, and manually rendering the circles using that layout. This has been a godsend, thank you.

But I discovered an issue - sometimes, in a particularly tight layout situation, the circles would layout so as to appear that an actually empty intersection is not empty.
For example:
image

I was able to fix this on our end by copying over the loss function but modifying this line
https://github.com/benfred/venn.js/blob/master/src/layout.js#L416

to turn it into
image

I believe this is better because as described in the screenshot, it weights small sets equally. I don't have time to open a PR but I wanted to drop this idea in because I think it's a good one.

The result is:
image