Comments (3)
Yeah - this is working like its supposed to (just not like you want it to =(.
I'm assuming that the output you want is something like this:
The problem with that diagram is that sets (0, 1, 3, 4) shouldn't be overlapping at all according to the overlap areas you are passing in - making it have a higher loss function than what its producing.
Look at PR #10 for a proposed method to overcome this. If it works for you - I'll merge it to master .
from venn.js.
Heh, that makes total sense. I suspected something like that but didn't know how to express it.
This code works great, except for the fact that the diagram produced is taller than it is wide. In the 625x375 window, it would fit better rotated 90 degrees, and other arrangements lay themselves out that way. I don't know if that's related to this at all; I can create a new issue if you want. Regardless, this is a great improvement for our case.
Here's an example of the code for a diagram that gets laid out horizontally, the way that it intuitively seems the above should be laid out:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script><script src="d3.js"></script><script src="venn.js"></script><script type="text/javascript">$(document).ready(function() { var sets = [{"id":60,"label":"0","size":1960,"radius":53.134792881788606,"y":301.26520711821144,"x":192.04953051060735},{"id":61,"label":"1","size":1858,"radius":51.73373226864182,"y":177.86981869734862,"x":71.73373226864182},{"id":62,"label":"2","size":298,"radius":20.718537149280536,"y":82.18273038458457,"x":192.04953051060735},{"id":63,"label":"3","size":17302,"radius":157.86981869734862,"y":177.86981869734862,"x":404.7991767045968},{"id":64,"label":"4","size":4301,"radius":78.71104488063317,"y":177.86981869734862,"x":192.04953051060735}]; var overlaps = [{"id":60,"sets":[4,0],"size":57},{"id":61,"sets":[4,1],"size":74},{"id":62,"sets":[4,2],"size":12},{"id":63,"sets":[4,3],"size":343},{"sets":[0,0],"size":0,"weight":1e-10},{"sets":[0,1],"size":0,"weight":1e-10},{"sets":[0,2],"size":0,"weight":1e-10},{"sets":[0,3],"size":0,"weight":1e-10},{"sets":[1,0],"size":0,"weight":1e-10},{"sets":[1,1],"size":0,"weight":1e-10},{"sets":[1,2],"size":0,"weight":1e-10},{"sets":[1,3],"size":0,"weight":1e-10},{"sets":[2,0],"size":0,"weight":1e-10},{"sets":[2,1],"size":0,"weight":1e-10},{"sets":[2,2],"size":0,"weight":1e-10},{"sets":[2,3],"size":0,"weight":1e-10},{"sets":[3,0],"size":0,"weight":1e-10},{"sets":[3,1],"size":0,"weight":1e-10},{"sets":[3,2],"size":0,"weight":1e-10},{"sets":[3,3],"size":0,"weight":1e-10}]; var combined = venn.venn(sets, overlaps); var diagram = venn.drawD3Diagram(d3.select('#overlap-chart'), combined, $('#overlap-chart').width(), 375);});</script><div id="overlap-chart" style="width: 624px; height: 374px;"></div>
Thanks so much for helping out with this. The implementation of this diagram in our platform has already really impressed people at my company.
from venn.js.
fixed by #10
from venn.js.
Related Issues (20)
- Default loss function should use log ratio, not subtraction
- Proper subset not displaying correctly
- Removing and readding a set quickly uninentionally hides the set
- Invisible triple intersection HOT 1
- Minimum circle size HOT 2
- Static size of circles HOT 2
- Label is displayed on other label
- Abandoned? Lots of good PRs out there. HOT 2
- could not find a declaration file for module 'venn.js' in React HOT 1
- Dependent d3 version5 for venn.js HOT 2
- Parsing a heading with each set of data
- Compatibility with d3-selection HOT 1
- url question about snowpack HOT 3
- could you publish the npm for the latest git code? HOT 3
- Uncaught initial bisect points must have opposite signs HOT 1
- How to fix circle same position on every refresh time in venn.js
- Custom circle colors HOT 1
- jsnext:main es6 problem HOT 1
- The calculation accuracy of function circleCircleIntersection problem
- Is there a way to programmatically get a list of intersections not shown. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from venn.js.