Use Venn in Vue
Closed this issue · 1 comments
zhe-he commented
test.vue
<template>
<div>
<div id="venn"></div>
</div>
</template>
<script>
import * as d3 from "d3"
import * as venn from 'venn.js'
export default {
mounted() {
this.$nextTick(() => {
var sets = [ {sets: ['A'], size: 12},
{sets: ['B'], size: 12},
{sets: ['A','B'], size: 2}];
var chart = venn.VennDiagram();
d3.select("#venn").datum(sets).call(chart);
});
}
}
</script>
zhe-he commented
Solved.
D3 can be introduced in the form of script
<script src="js/d3.js"></script>