Description Usage Arguments Details Value JavaScript Libraries See Also Examples
Draw a Venn diagram given a data frame with the sizes and names of the sets.
1 2 3 4 5 6 7 8 |
sets |
data.frame, each row correspond to one part in the Venn diagram. Must
contain columns |
fill_colors, text_color |
character, vector of colors for filling the circles and
the text respectively. Must be interpretable by css (see
|
center_text |
boolean, should the circles' texts be centered horizontally and vertically? |
width |
integer, width of the htmlwidget. |
height |
integer, height of the htmlwidget. |
To pass the size (and or label) of the intersections, the corresponding sets
element
must contain a list. To create list
columns you can use base::I()
. See Examples.
an htmlwidget
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # Venn diagram with 2 disjoint sets both of equal size
d3Venn(data.frame(sets = c("A", "B"), size = c(20, 20)))
# Venn diagram with 2 disjoint sets with differnt sizes and labels
d3Venn(data.frame(sets = c("A", "B"), size = c(10, 20), label = c("Set 1", "Set 2")))
# Venn diagram with 2 overlapping sets
d3Venn(data.frame(sets = I(list("A", "B", list("A", "B"))),
size = c(10, 10, 2)))
# Venn diagram where B is a subset of A
d3Venn(data.frame(sets = I(list("A", "B", list("A", "B"))),
size = c(20, 10, 10)))
# Venn diagram with differnt colors and centered text
d3Venn(data.frame(sets = I(list("A", "B", list("A", "B"))),
size = c(20, 20, 10)),
c("cornflowerblue", "hsl(300, 100%, 70%)"),
"#FFA500",
TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.