Skip to content

Instantly share code, notes, and snippets.

@dima74
Created April 10, 2018 23:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dima74/ce625fd42e39672fd9e044f4c4a65ec3 to your computer and use it in GitHub Desktop.
Save dima74/ce625fd42e39672fd9e044f4c4a65ec3 to your computer and use it in GitHub Desktop.
fresh block
license: mit
<html>
<body>
<svg id="main-svg" width="800" height="800">
<svg id="inner_svg_which_would_be_used_by_venn"></svg>
</svg>
</body>
<script src="https://d3js.org/d3.v5.min.js"></script>
<script src="https://rawgit.com/benfred/venn.js/master/venn.js"></script>
<script>
// define sets and set set intersections
const sets = [
{ sets: ['A'], size: 12 },
{ sets: ['B'], size: 12 },
{ sets: ['A', 'B'], size: 2 },
];
const chart = venn.VennDiagram();
d3.select('#main-svg').datum(sets).call(chart);
const rootSvg = d3.select('#inner_svg_which_would_be_used_by_venn');
// use rootSvg somehow
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment